From 07749594df1e0f261664e44f4b7fba85c617594e Mon Sep 17 00:00:00 2001 From: OverflowCat Date: Tue, 17 Jun 2025 10:07:34 +0800 Subject: [PATCH] Add leading digit support for variable Co-authored-by: yzqzss <30341059+yzqzss@users.noreply.github.com> --- grammars/css.cson | 8 +++----- spec/css-spec.mjs | 13 +++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/grammars/css.cson b/grammars/css.cson index 6256e55..9b9dc03 100644 --- a/grammars/css.cson +++ b/grammars/css.cson @@ -1038,10 +1038,9 @@ 'name': 'variable.argument.css' 'match': '''(?x) -- - (?:[-a-zA-Z_] | [^\\x00-\\x7F]) # First letter - (?:[-a-zA-Z0-9_] | [^\\x00-\\x7F] # Remainder of identifier + (?:[-a-zA-Z0-9_] | [^\\x00-\\x7F] |\\\\(?:[0-9a-fA-F]{1,6}|.) - )* + )+ ''' } { @@ -1702,10 +1701,9 @@ # Custom properties 'match': '''(?x) (?