Object interpolation of custom properties should not be hyphenated #710
Labels
enhancement: proposal 💬
Improvement of current behaviour that needs to be discussed
needs: triage 🏷
Issue needs to be checked and prioritized
Describe the enhancement
Object interpolation should not hyphenate user-specified CSS custom property definitions.
Motivation
For instance, in my current setup using Linaria (2.0.2), the following simple example:
produces the following CSS:
I would not have expected custom properties to receive this treatment, though I understand that regular CSS identifiers like
fontSize
andborderRadius
would. I would have expected.className
styles to look like this:The current implementation makes it so that if I generate
cssVars
I have to either mirror the transformation in my code or work around it by converting the object to a string myself and interpolating that.Possible implementations
I'm thinking that perhaps the
toCSS
function should check for the--
prefix before hyphenating the key. The following diff could be sufficient, or something to this effect:Related Issues
N/A
The text was updated successfully, but these errors were encountered: