From 58fb21cbb685802ad0a6c88de74da26add86220a Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sat, 4 Jan 2025 19:28:28 +0100 Subject: [PATCH] Add support for wildcards in custom properties Used in @themes by Tailwind CSS 4.0 --- Tailwind CSS.sublime-syntax | 8 ++++++++ tests/syntax_test.tailwind.css | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Tailwind CSS.sublime-syntax b/Tailwind CSS.sublime-syntax index 95248dd..9bdd138 100644 --- a/Tailwind CSS.sublime-syntax +++ b/Tailwind CSS.sublime-syntax @@ -57,6 +57,7 @@ contexts: properties-or-selectors: # required until ST4174 (PR #3898) + - include: custom-properties - match: '{{property_or_selector_begin}}' branch_point: property-or-selector branch: @@ -113,6 +114,13 @@ contexts: - match: ',' scope: invalid.illegal.unexpected-token.css +###[ CSS PROPERTY IDENTIFIERS ]################################################ + + custom-property-content: + - meta_prepend: true + - match: \* + scope: constant.other.wildcard.asterisk.css.tailwind + ###[ TAILWIND INLINE AT RULES ]################################################ tailwind-at-apply: diff --git a/tests/syntax_test.tailwind.css b/tests/syntax_test.tailwind.css index 44ca033..5cdf765 100644 --- a/tests/syntax_test.tailwind.css +++ b/tests/syntax_test.tailwind.css @@ -155,6 +155,25 @@ /*^^^^^^ meta.at-rule.theme.css.tailwind */ /*^^^^ keyword.control.directive.css.tailwind */ /* ^ meta.block.css punctuation.section.block.begin.css */ + + --*: initial; +/*^^^^^^^^^^^^^ meta.at-rule.theme.css.tailwind meta.block.css */ +/*^^^ meta.property-name.css entity.other.custom-property.css */ +/* ^ constant.other.wildcard.asterisk.css.tailwind */ +/* ^ punctuation.separator.key-value.css */ +/* ^^^^^^^^ meta.property-value.css */ +/* ^^^^^^^ support.constant.property-value.css */ +/* ^ punctuation.terminator.rule.css */ + + --font-*: initial; +/*^^^^^^^^^^^^^^^^^^ meta.at-rule.theme.css.tailwind meta.block.css */ +/*^^^^^^^^ meta.property-name.css entity.other.custom-property.css */ +/* ^ constant.other.wildcard.asterisk.css.tailwind */ +/* ^ punctuation.separator.key-value.css */ +/* ^^^^^^^^ meta.property-value.css */ +/* ^^^^^^^ support.constant.property-value.css */ +/* ^ punctuation.terminator.rule.css */ + --font-display: "Satoshi", "sans-serif"; /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.at-rule.theme.css.tailwind meta.block.css */ /*^^^^^^^^^^^^^^ meta.property-name.css entity.other.custom-property.css */