-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve automatic var
injection
#12236
Conversation
…dent>` for the value
@thecrypticace what do you think about this solution? This only solves it for arbitrary properties, and not when you use it inside of a plugin. Alternatively we can write a Lightning CSS plugin that strips the But, not generating them in the first place seems better I think. Also, it looks like you can't use Example of what I mean with variables: https://play.tailwindcss.com/Y5fbjtUBHa |
I think this is the better route. Creating a lightning CSS plugin to do this I think would be a bad idea. I kinda feel like specifying these values with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other than needing to add the font-palette
property and cleanup that one if statement.
LGTM. The |
* prevent automatic var injection for properties that accept `<dashed-ident>` for the value * add test * add `font-palette` * improve readability
* prevent automatic var injection for properties that accept `<dashed-ident>` for the value * add test * add `font-palette` * improve readability
@RobinMalfait Can this be extended to |
+1 as I'm currently experiencing this issue while transitioning @Property values. Currently using an underscore (e.g., |
This PR improves the automatic
var
injection behaviour.When using arbitrary properties such as:
Then the compiled CSS will be:
However, the
timeline-scope
property accepts a<dashed-ident>
data type, which means that the value should stay as--foo
, and notvar(--foo)
.This PR has an exceptions list for these properties, and won't wrap the variable with
var()
for properties that accept<dashed-ident>
.More info:
Fixes: #12205