Skip to content

Commit f8cc5fb

Browse files
committed
Simplify based on ST4180
This commit removes all obsolete overrides and adds pure CSS syntax tests. ST4180 fully supports relaxed CSS nesting.
1 parent 90ce805 commit f8cc5fb

File tree

2 files changed

+4471
-66
lines changed

2 files changed

+4471
-66
lines changed

PostCSS.sublime-syntax

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ file_extensions:
1313
variables:
1414
ident_start: (?:{{nmstart}}|\$\()
1515

16-
# Properties and Selectors
17-
property_or_selector_begin: (?={{ident_begin}}|{{selector_start}})
18-
property_end: (?=[;@)}])
19-
20-
selector_start: '[[:alpha:].:#&*\[{{combinator_char}}]'
21-
selector_end: (?=[;@(){}])
22-
2316
contexts:
2417

2518
###[ CSS ]#####################################################################
@@ -31,16 +24,9 @@ contexts:
3124
- meta_scope: source.css.postcss
3225

3326
stylesheet:
34-
# required until ST4174 (PR #3898)
27+
- meta_prepend: true
3528
- include: postcss-variable-definitions
3629
- include: postcss-variables
37-
- include: comments
38-
- include: property-lists
39-
- include: properties-or-selectors # lazily match properties everywhere
40-
- include: at-rules
41-
- include: rule-terminators
42-
- include: illegal-commas
43-
- include: illegal-groups
4430

4531
###[ CSS COMMENTS ]############################################################
4632

@@ -61,68 +47,22 @@ contexts:
6147

6248
at-other:
6349
- meta_prepend: true
64-
# known PostCSS at rules
6550
- include: postcss-at-apply
6651
- include: postcss-at-each
6752
- include: postcss-at-functions
6853
- include: postcss-at-mixins
6954
- include: postcss-at-return
7055
- include: postcss-at-other
7156

72-
###[ CSS SELECTORS ]###########################################################
73-
7457
properties-or-selectors:
75-
# required until ST4174 (PR #3898)
76-
- include: custom-properties
77-
- match: '{{property_or_selector_begin}}'
78-
branch_point: property-or-selector
79-
branch:
80-
- maybe-property
81-
- selector-body
82-
83-
maybe-property:
84-
# required until ST4174 (PR #3898)
85-
- meta_include_prototype: false
86-
- include: property-end
87-
- include: property-identifiers
88-
- match: ''
89-
fail: property-or-selector
90-
91-
property-end:
92-
# required until ST4174 (PR #3898)
93-
- match: '{{property_end}}'
94-
pop: 1
95-
96-
selector-variables:
97-
# required until ST4174 (PR #3898)
58+
# required until (ST4xxx PR #4052)
9859
- meta_prepend: true
99-
- match: \&
100-
scope: variable.language.parent.css
101-
102-
###[ CSS PROPERTY LISTS ]######################################################
103-
104-
maybe-property-list:
105-
# required until ST4174 (PR #3831)
106-
- meta_include_prototype: false
107-
- match: \{
108-
scope: punctuation.section.block.begin.css
109-
set: property-list-body
110-
- include: comments
111-
- include: else-pop
60+
- include: custom-properties
11261

11362
property-list-body:
114-
# required until ST4174 (PR #3898)
115-
- meta_scope: meta.property-list.css meta.block.css
116-
- meta_include_prototype: false
117-
- include: block-end
118-
- include: stylesheet
119-
120-
illegal-commas:
121-
# required until ST4174 (PR #3831)
122-
- match: ','
123-
scope: invalid.illegal.unexpected-token.css
124-
125-
###[ CSS PROTOTYPES ]##########################################################
63+
- meta_prepend: true
64+
- include: postcss-variable-definitions
65+
- include: postcss-variables
12666

12767
function-arguments-prototype:
12868
- meta_prepend: true

0 commit comments

Comments
 (0)