fix: treat at-rule names as case-insensitive across rules#233
Conversation
|
|
||
| return { | ||
| "Atrule[name=import]"(node) { | ||
| "Atrule[name=/^import$/i]"(node) { |
There was a problem hiding this comment.
Can you also share the official reference where it is mentioned these are case insensitive?
There was a problem hiding this comment.
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. |
nzakas
left a comment
There was a problem hiding this comment.
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?