Remove automatic var(…)
injection
#13657
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a continuation of #13537.
Currently we reverted the merged changes so that we can get a new alpha version out without this change.
This PR removes automatic
var(…)
injection for arbitrary properties, values and modifiers.There are a few properties that use "dashed-ident" values, this means
that you can use
--my-thing
as-is without thevar(…)
around it.E.g.:
This causes issues because we are now injecting a
var(…)
where it's not needed.One potential solution is to create a list of properties where dashed idents can be used. However, they can also use CSS custom properties that point to another dashed ident.
E.g.:
A workaround that some people used is adding a
_
in front of the variable:mt-[_--my-thing]
this way we don't automatically inject thevar(…)
around it. This is a workaround and gross.While the idea of automatic var injection is neat, this causes more trouble than it's worth. Adding
var(…)
explicitly is better.A side effect of this is that we can simplify the internals for the
candidate
data structure because we don't need to trackdashedIdent
separately anymore.