You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nospace: {"@media (min-width:1px)": {color: ({ color })=>color}},space: {"@media (min-width: 1px)": {color: ({ color })=>color}},
The first one does not work, but the second one does. The difference is the missing space between min-width: and 1px.
I’ve tracked this down to RuleList.link() where the key given by DomRenderer.getKey() is sanitised by the browser, whereas the key originally used in this.map was not.
I’m not sure the best way to fix this. Now that I know the problem, the workaround is obvious, but it seems like something we should fix because it was quite difficult to figure out why my rules weren’t working.
This is the same problem first reported by @jpetitcolashere, in whose case the error was caused by using :after instead of the more correct ::after.
The text was updated successfully, but these errors were encountered:
We could write a plugin, or a linter that checks for those things in development, maintaining all of these things which are being sanitized by browsers isn't possible.
The linter would be naturally more complicated though.
I think we should get rid of linking altogether by always using insertRule api when its a function rule/value. So that we don't have to do this fragile linking logic at all.
Minimal reproduction: https://codesandbox.io/s/016vzn15ol
If I define two dynamic rules like this:
The first one does not work, but the second one does. The difference is the missing space between
min-width:
and1px
.I’ve tracked this down to RuleList.link() where the key given by
DomRenderer.getKey()
is sanitised by the browser, whereas the key originally used inthis.map
was not.I’m not sure the best way to fix this. Now that I know the problem, the workaround is obvious, but it seems like something we should fix because it was quite difficult to figure out why my rules weren’t working.
This is the same problem first reported by @jpetitcolas here, in whose case the error was caused by using
:after
instead of the more correct::after
.The text was updated successfully, but these errors were encountered: