-
Notifications
You must be signed in to change notification settings - Fork 215
scuffed @custom-variant behavior #1211
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
Comments
The problem also happens with this snippet from the documentation. @custom-variant supports-grid {
@supports (display: grid) {
@slot;
}
} ![]() |
@gustavopch is this with the fixes applied, or original extension? |
The original extension. Didn't try your patch. |
It has been happening since |
yep it did — sorry! Obviously I need to add automated tests for the css language mode this week. Gonna push a fix out today. |
Registering a v4 custom-variant with a nested (pseudo-)selector causes "at-rule or selector expected". It compiles just fine.
The last 2 errors go away on removing the
@slot
s;
. However, this is not a viable option, as Prettier adds it back.Oddly enough, it seems to replace this with... whatever this mess is.
This happens because the Regex matches up to a
;
:(\s+[^;]+)
. I'm not sure what the point of this is.There is another matcher that uses { right below, but it never gets called, as the matcher with the ; already
replaces everything up to the slot semicolon.
Removing it seems to have done the trick. All tests pass with this change.
... now this throws. Even if I restore the original extension. lovely.
The space was added by Prettier, but this also happens without it. Adding other spaces restores it to
[ *]
, so my PR allows a space before*
.It seems like it doesn't like *. Replacing it with _ in the virtual document works fine. All tests pass with this change.
I'd like to work on this. I'll follow up with a PR in a bit.
The text was updated successfully, but these errors were encountered: