Support extracting unquoted class attribute values
Clear and concise description of the problem
Some toolkits, such as React/JSX, do not support unquoted attribute values. But HTML, both traditional relaxed parsing and modern HTML5, support them. Toolkits like Svelte also support them, where they are considered raw string values à la HTML. This is actually one of the things I like about using Svelte, and it's in the style guide my team is following to omit unnecessary quotes where possible.
However, it seems in my testing the Uno extractor does not support this use-case, and will not parse class attribute values specified without quotes surrounding them. Is this a toggleable configuration, or otherwise are the extraction semantics open to allow customizing how attribute values are parsed?
I have looked in the documentation and other issues and haven't found anything mentioning this. (Docs search kinda sucks so I apologize if it's mentioned and I didn't see it.)
Suggested solution
Parse quoted and unquoted attribute values, both with the same semantics. If this conflicts with existing functionality, make it a toggleable option.
Alternative
Surround class attribute values (and only class attribute values) with quotes to please the Uno parser when necessary.
Additional context
No response
Validations
- Read the Contributing Guidelines.
- Read the
README.mdof using the package. - Already used the Interactive Docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Source: unocss/unocss