json-viewer icon indicating copy to clipboard operation
json-viewer copied to clipboard

Feature Request: CSS variable for padding

Open Canuckaholic opened this issue 2 years ago • 2 comments

I would like to request a CSS variable be added for padding to the wrapping shadow DOM element (ul tag), so one can add a little space to the content, especially when it's long and needs to scroll. Thanks!

Canuckaholic avatar May 20 '22 01:05 Canuckaholic

Hi @Canuckaholic, have you already tried styling the custom element?

json-viewer {
    padding: 1rem;
}

Let me know whether this is sufficient, otherwise we could think to add a part attribute to make it possible to apply custom styles to the UL tag.

alenaksu avatar May 20 '22 15:05 alenaksu

Hi @alenaksu ... yes I tried styling the web component itself, but I wasn't able to get the bottom padding that I was looking for, which is why I think I need to be able to add padding to the shadow DOM element.

Canuckaholic avatar May 20 '22 16:05 Canuckaholic

hi @Canuckaholic, I published a new version of the package that includes new CSS parts that can be used to customize further the component. Please take a look at the readme, I'm curious to know what you think.

https://github.com/alenaksu/json-viewer#css-parts

alenaksu avatar Oct 06 '22 15:10 alenaksu