-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
CSS classes starting with -
is always unused and --
throws
#1710
Comments
-
-
is always unused and --
throws
The 'identifier is expected' exception that's thrown in the second example is thrown by the underlying The issue with class names beginning with a single hyphen does seem to be an issue on our end though. edit: There is a highly upvoted comment on that answer though that says "The W3C says that the use of a leading '-' or '_' should be reserved for vendor-specific CSS extensions" - I don't know whether that affects what we want to do here. Probably not? |
The problem is that When testing whether a selector with a class matches against an element, we are using the same implementation as when we are checking whether an attribute matches according to the Edit: Checking on what |
Reworking the handling of all of the operators in Selector.ts to not use regular expressions is probably the best way to do this, which will also fix other weird edge cases with selectors being interpreted as regular expressions. For example, the selector |
Circling back on this a little bit - What I have now is in this branch. It's failing a test though (and it's breaking some other things that are not currently tested for) because the class/etc names in selectors are no longer getting unescaped, and so are incorrectly seen as not matching the appropriate elements. I'll need to look into exactly what sorts of escaping can happen in those. What we're doing currently is just treating them as regexes and sort of taking care of the |
CSS allow classes starting with
-
, but the svelte compiler flags them as unused REPLWith double
--
it's even worse REPLThe text was updated successfully, but these errors were encountered: