Skip to content

Allow customizing editor min height and width #30

Open
@grahamhoyes

Description

@grahamhoyes

Feature request

Use Case

I've started integrating this widget into an unfold-based admin site. For small (or empty) data, the min-height: 480px on .svelte-jsoneditor-wrapper leaves quite the large UI gap:

image

Current state

The .svelte-jsoneditor-wrapper class leaves a large UI gap, as well as inconsistent widths with other elements

Proposed Solution

There are a few ways around this I could see:

  • Just remove min-height from .svelte-jsoneditor-wrapper, though there may be use cases where it's warranted. Still leaves the issue with the hard-coded width as well
  • I could provide my own CSS / override the template to change the CSS class definition
  • Making the class list customizable would be ideal. Default to .svelte-jsoneditor-wrapper for backwards compatibility, but would allow me to set eg w-full max-w-2xl from tailwind which gives a seamless UI as seen below

image

I'm happy to help make these changes!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions