-
Notifications
You must be signed in to change notification settings - Fork 61
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
ID selector syntax #24
Comments
I’m not sure if this is a feature request or a bug 😅 |
This is a bug report. The tokenizer code does not match the Selectors specification: https://drafts.csswg.org/selectors/#id-selectors
The syntax for identifiers has some restrictions. For example it cannot start wit a digit, so A Some inputs like In Python terms, |
I’ve been looking into this, and I see that a lot of people has gotten bitten by this when trying to style elements with such IDs, which are valid HTML IDs, but for some reason not valid CSS IDs. Instead of adjusting our code to the standard, I wonder if it would not be better to keep support for this syntax, and instead indicate this explicitly as a feature of Unless there’s a good reason not to allow this syntax, i.e. a selector that should work 1 way and because of supporting this syntax it works unexpectedly, I really think it would be best to keep the implementation as it is. @annbgn I’m sorry to suggest this when you have already worked on a patch. |
The spec’ed syntax for ID selectors is
#
followed by an identifier, not any hash token. See the "type" flag on hash tokens in css-syntax.The text was updated successfully, but these errors were encountered: