Skip to content

noQuotesForStringValues not applied to empty string #45

@fabiradi

Description

@fabiradi

When using the option noQuotesForStringValues, you are able to add your own quotes via CSS.

However, empty strings still have quotes added due to this line:

return !value || quoted ? `"${value}"` : value;

... which looks ok-ish without CSS quotes, but just wrong with CSS add

⚠️ noQuotesForStringValues: true

This is my version with CSS quotes:
empty-quotes-CSS

It can even be replicated in Storybook (via controls):
empty-quotes-sb
ed.

noQuotesForStringValues: false

This looks fine, if no CSS are added:
empty-quotes-regular

Can the check !value be changed into a more precise one with better handling of empty strings or should empty strings appear differently? I could create a PR, if the change would be fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions