From a2235085741f422857c90733423f38ef67824f57 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sat, 26 Oct 2024 09:41:33 +0200 Subject: [PATCH] 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. --- .github/workflows/ci-syntax-tests.yml | 18 ++---- Tailwind CSS.sublime-syntax | 87 --------------------------- 2 files changed, 6 insertions(+), 99 deletions(-) diff --git a/.github/workflows/ci-syntax-tests.yml b/.github/workflows/ci-syntax-tests.yml index b32e1c9..e1f0e36 100644 --- a/.github/workflows/ci-syntax-tests.yml +++ b/.github/workflows/ci-syntax-tests.yml @@ -27,18 +27,12 @@ jobs: strategy: matrix: include: - - build: 4107 - default_packages: v4107 - - build: 4126 - default_packages: v4126 - - build: 4143 - default_packages: v4143 - - build: 4152 - default_packages: v4152 - - build: 4169 - default_packages: v4169 - - build: 4173 - default_packages: v4173 + - build: 4174 # first supported build + default_packages: v4174 + - build: 4180 # first stable build + default_packages: v4180 + - build: latest + default_packages: master steps: - name: Checkout Default Packages uses: actions/checkout@v4 diff --git a/Tailwind CSS.sublime-syntax b/Tailwind CSS.sublime-syntax index 992c429..0128438 100644 --- a/Tailwind CSS.sublime-syntax +++ b/Tailwind CSS.sublime-syntax @@ -9,35 +9,8 @@ extends: Packages/CSS/CSS.sublime-syntax file_extensions: - tailwind.css -variables: - - # Block punctuations - # Provides an easy and safe interface for template syntaxes to override - # block punctuation patterns to prevent ambiguities with interpolations. - # It helps to correctly highlight {{ tag }} { {{prop}}: {{value}} } - block_start: \{ - block_end: \} - - # Properties and Selectors - property_or_selector_begin: (?={{ident_begin}}|{{selector_start}}) - property_end: (?=[;@)}]) - - selector_start: '[[:alpha:].:#&*\[{{combinator_char}}]' - selector_end: (?=[;@(){}]) - contexts: - stylesheet: - # relaxed properties vs. selectors - - meta_include_prototype: false - - include: comments - - include: properties-or-selectors - - include: at-rules - - include: property-lists - - include: rule-terminators - - include: illegal-commas - - include: illegal-groups - ###[ CSS AT RULES ]############################################################ at-other: @@ -49,66 +22,6 @@ contexts: - include: tailwind-at-variants - include: tailwind-at-screen -###[ CSS SELECTORS ]########################################################### - - properties-or-selectors: - # required until ST4174 (PR #3898) - - match: '{{property_or_selector_begin}}' - branch_point: property-or-selector - branch: - - maybe-property - - selector-body - - maybe-property: - # required until ST4174 (PR #3898) - - meta_include_prototype: false - - include: property-end - - include: property-identifiers - - match: '' - fail: property-or-selector - - property-end: - # required until ST4174 (PR #3898) - - match: '{{property_end}}' - pop: 1 - - selector-variables: - # required until ST4174 (PR #3898) - - meta_prepend: true - - match: \& - scope: variable.language.parent.css - -###[ CSS STYLESHEET BLOCKS ]#################################################### - - maybe-stylesheet-block: - # required until ST4174 (PR #3831) - - meta_include_prototype: false - - match: '{{block_start}}' - scope: punctuation.section.block.begin.css - set: stylesheet-block-body - - include: comments - - include: else-pop - - stylesheet-block-body: - # required until ST4174 (PR #3831) - - meta_include_prototype: false - - meta_scope: meta.block.css - - include: block-end - - include: stylesheet - -###[ CSS PROPERTY LISTS ]###################################################### - - property-list-body: - # relaxed properties vs. selectors - - meta_scope: meta.property-list.css meta.block.css - - include: block-end - - include: stylesheet - - illegal-commas: - # required until ST4174 (PR #3831) - - match: ',' - scope: invalid.illegal.unexpected-token.css - ###[ TAILWIND INLINE AT RULES ]################################################ tailwind-at-apply: