Skip to content

Commit a223508

Browse files
author
deathaxe
committed
Base syntax on CSS of ST4174
ST4174 introduced support for relaxed CSS nesting which basically means, full PostCSS like nesting of selectors and rules. This reduces Tailwind CSS to just adding some additional at-rules. All other structure modifying context overrides are removed to ensure compatibility with core CSS.
1 parent a4ca62e commit a223508

File tree

2 files changed

+6
-99
lines changed

2 files changed

+6
-99
lines changed

.github/workflows/ci-syntax-tests.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,12 @@ jobs:
2727
strategy:
2828
matrix:
2929
include:
30-
- build: 4107
31-
default_packages: v4107
32-
- build: 4126
33-
default_packages: v4126
34-
- build: 4143
35-
default_packages: v4143
36-
- build: 4152
37-
default_packages: v4152
38-
- build: 4169
39-
default_packages: v4169
40-
- build: 4173
41-
default_packages: v4173
30+
- build: 4174 # first supported build
31+
default_packages: v4174
32+
- build: 4180 # first stable build
33+
default_packages: v4180
34+
- build: latest
35+
default_packages: master
4236
steps:
4337
- name: Checkout Default Packages
4438
uses: actions/checkout@v4

Tailwind CSS.sublime-syntax

-87
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,8 @@ extends: Packages/CSS/CSS.sublime-syntax
99
file_extensions:
1010
- tailwind.css
1111

12-
variables:
13-
14-
# Block punctuations
15-
# Provides an easy and safe interface for template syntaxes to override
16-
# block punctuation patterns to prevent ambiguities with interpolations.
17-
# It helps to correctly highlight {{ tag }} { {{prop}}: {{value}} }
18-
block_start: \{
19-
block_end: \}
20-
21-
# Properties and Selectors
22-
property_or_selector_begin: (?={{ident_begin}}|{{selector_start}})
23-
property_end: (?=[;@)}])
24-
25-
selector_start: '[[:alpha:].:#&*\[{{combinator_char}}]'
26-
selector_end: (?=[;@(){}])
27-
2812
contexts:
2913

30-
stylesheet:
31-
# relaxed properties vs. selectors
32-
- meta_include_prototype: false
33-
- include: comments
34-
- include: properties-or-selectors
35-
- include: at-rules
36-
- include: property-lists
37-
- include: rule-terminators
38-
- include: illegal-commas
39-
- include: illegal-groups
40-
4114
###[ CSS AT RULES ]############################################################
4215

4316
at-other:
@@ -49,66 +22,6 @@ contexts:
4922
- include: tailwind-at-variants
5023
- include: tailwind-at-screen
5124

52-
###[ CSS SELECTORS ]###########################################################
53-
54-
properties-or-selectors:
55-
# required until ST4174 (PR #3898)
56-
- match: '{{property_or_selector_begin}}'
57-
branch_point: property-or-selector
58-
branch:
59-
- maybe-property
60-
- selector-body
61-
62-
maybe-property:
63-
# required until ST4174 (PR #3898)
64-
- meta_include_prototype: false
65-
- include: property-end
66-
- include: property-identifiers
67-
- match: ''
68-
fail: property-or-selector
69-
70-
property-end:
71-
# required until ST4174 (PR #3898)
72-
- match: '{{property_end}}'
73-
pop: 1
74-
75-
selector-variables:
76-
# required until ST4174 (PR #3898)
77-
- meta_prepend: true
78-
- match: \&
79-
scope: variable.language.parent.css
80-
81-
###[ CSS STYLESHEET BLOCKS ]####################################################
82-
83-
maybe-stylesheet-block:
84-
# required until ST4174 (PR #3831)
85-
- meta_include_prototype: false
86-
- match: '{{block_start}}'
87-
scope: punctuation.section.block.begin.css
88-
set: stylesheet-block-body
89-
- include: comments
90-
- include: else-pop
91-
92-
stylesheet-block-body:
93-
# required until ST4174 (PR #3831)
94-
- meta_include_prototype: false
95-
- meta_scope: meta.block.css
96-
- include: block-end
97-
- include: stylesheet
98-
99-
###[ CSS PROPERTY LISTS ]######################################################
100-
101-
property-list-body:
102-
# relaxed properties vs. selectors
103-
- meta_scope: meta.property-list.css meta.block.css
104-
- include: block-end
105-
- include: stylesheet
106-
107-
illegal-commas:
108-
# required until ST4174 (PR #3831)
109-
- match: ','
110-
scope: invalid.illegal.unexpected-token.css
111-
11225
###[ TAILWIND INLINE AT RULES ]################################################
11326

11427
tailwind-at-apply:

0 commit comments

Comments
 (0)