From 608125206df49e871983fc84c818417f199c9aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Sch=C3=B6nb=C3=A4chler?= <42278642+schoero@users.noreply.github.com> Date: Sun, 1 Sep 2024 17:32:18 +0200 Subject: [PATCH] fix: highlighting fixes for functions --- syntaxes/tailwindcss.json | 42 ++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/syntaxes/tailwindcss.json b/syntaxes/tailwindcss.json index 1e0e1b7..e153b10 100644 --- a/syntaxes/tailwindcss.json +++ b/syntaxes/tailwindcss.json @@ -129,16 +129,34 @@ "name": "keyword.operator.assignment.tailwindcss" }, "3": { - "name": "support.constant.property-value.css.tailwindcss", "patterns": [ { + "captures": { + "1": { + "name": "property-value.tailwindcss", + "patterns": [ + { + "include": "#numbers" + }, + { + "include": "#functions" + }, + { + "include": "#selectors" + }, + { + "include": "#commas" + } + ] + } + }, "match": "(.*)", - "name": "property-value.tailwindcss" + "name": "support.constant.property-value.css.tailwindcss" } ] } }, - "match": "([\\w-]+)(:)([\\w-]+)" + "match": "([\\w-]+)(:)(.*)" }, { "include": "#numbers" @@ -148,6 +166,9 @@ }, { "include": "#selectors" + }, + { + "include": "#commas" } ] }, @@ -155,7 +176,7 @@ "name": "meta.brace.square.tailwindcss" } }, - "match": "(\\[)(.*)?(\\])" + "match": "(\\[)(.*)(\\])" } ] }, @@ -202,6 +223,14 @@ } ] }, + "commas": { + "captures": { + "1": { + "name": "punctuation.separator.comma.tailwindcss" + } + }, + "match": "(,)" + }, "functions": { "patterns": [ { @@ -222,6 +251,9 @@ }, { "include": "#operators" + }, + { + "include": "#commas" } ] }, @@ -229,7 +261,7 @@ "name": "punctuation.section.function.end.bracket.round.css.tailwindcss" } }, - "match": "(\\w+)(\\()(.*?)(\\))" + "match": "([\\w-]+)(\\()(.*?)(\\))" } ] },