Skip to content

Commit

Permalink
Add support for wildcards in custom properties
Browse files Browse the repository at this point in the history
Used in @themes by Tailwind CSS 4.0
  • Loading branch information
deathaxe committed Jan 4, 2025
1 parent 35951b3 commit 58fb21c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tailwind CSS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions tests/syntax_test.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 58fb21c

Please sign in to comment.