-
-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
- Node Version: 8.3.0
- NPM Version: 5.3.0
- postcss-less Version: 1.1.0
LESS
a{k: v !IMPORTANT;}JavaScript
console.dir(require("postcss-less").parse('a{k: v !IMPORTANT;}'), {colors: true, depth: null})Expected Behavior
The declaration should be parsed as:
Declaration {
prop: 'k',
important: true,
value: 'v'
}
Just like for a{k: v !important;}.
Actual Behavior
The declaration is parsed as:
Declaration {
prop: 'k',
value: 'v !IMPORTANT' }
}
How can we reproduce the behavior?
console.dir(require("postcss-less").parse('a{k: v !IMPORTANT;}'), {colors: true, depth: null})Spec
CSS is actually mostly case insensitive. Here is the spec mentioning how !important should be parsed case insensitively: https://www.w3.org/TR/css-syntax-3/#consume-a-declaration
If the last two non-
<whitespace-token>s in the declaration’s value are a<delim-token>with the value "!" followed by an<ident-token>with a value that is an ASCII case-insensitive match for "important", remove them from the declaration’s value and set the declaration’s important flag to true.
Related
Metadata
Metadata
Assignees
Labels
No labels