-
-
Notifications
You must be signed in to change notification settings - Fork 26
fix: treat at-rule names as case-insensitive across rules #233
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
fix: treat at-rule names as case-insensitive across rules #233
Conversation
@@ -42,7 +42,7 @@ export default { | |||
const imports = new Set(); | |||
|
|||
return { | |||
"Atrule[name=import]"(node) { | |||
"Atrule[name=/^import$/i]"(node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also share the official reference where it is mentioned these are case insensitive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The at-rules affected in this PR are defined across different specs, so I’ll need to track down the relevant references. In the meantime, here’s a StackBlitz reproduction for @import
.
CSS at-rules are case sensitive, so closing. |
@nzakas CSS at-rule names are case-insensitive. I tested each at-rule changed in this PR to confirm this before opening it. Here is a StackBlitz reproduction for |
@thecalamiity it appears you are correct. I had to dig deep into the spec to find this:
In the future, keep in mind that simple repros in a single browser don't mean much -- browsers can implement things different ways. What is more useful is finding the text in the specification that backs up your claim. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Would like @snitin315 to review before merging.
Prerequisites checklist
What is the purpose of this pull request?
Ensure at-rule names are treated case-insensitively across rules, aligning with CSS syntax and preventing missed detections when authors use mixed-case at-rules.
What changes did you make? (Give an overview)
Related Issues
Is there anything you'd like reviewers to focus on?