Add important

This commit is contained in:
Max Brunsfeld 2018-10-26 11:42:36 -07:00
parent b2c8e4a547
commit d9f5080cca
4 changed files with 1945 additions and 1804 deletions

View File

@ -111,3 +111,19 @@ a {
(selectors (tag_name))
(block
(declaration (property_name) (plain_value)))))
============================
Important declarations
============================
a {
b: c !important;
}
---
(stylesheet
(rule_set
(selectors (tag_name))
(block
(declaration (property_name) (plain_value) (important)))))

View File

@ -139,9 +139,12 @@ module.exports = grammar({
optional(','),
$._value
)),
optional($.important),
';'
)),
important: $ => '!important',
// Media queries
_query: $ => choice(

16
src/grammar.json vendored
View File

@ -627,6 +627,18 @@
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "important"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ";"
@ -634,6 +646,10 @@
]
}
},
"important": {
"type": "STRING",
"value": "!important"
},
"_query": {
"type": "CHOICE",
"members": [

3714
src/parser.c vendored

File diff suppressed because it is too large Load Diff