From a27aeda57f4f18e7adf28d97535b947140168adf Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Sat, 25 May 2024 11:09:59 +0200 Subject: [PATCH 1/2] Add transition-behavior property --- CSS3.sublime-syntax | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CSS3.sublime-syntax b/CSS3.sublime-syntax index 6848ddf..e940f47 100644 --- a/CSS3.sublime-syntax +++ b/CSS3.sublime-syntax @@ -10380,6 +10380,20 @@ contexts: - include: single-transition - include: stray-paren-or-semicolon + # CSS Transitions + property-transition-behavior: + - match: \b(transition-behavior)\s*(:) + captures: + 1: support.type.property-name.css + 2: punctuation.separator.key-value.css + push: + - meta_content_scope: meta.property-value.transition-behavior.css + - include: end-value + - include: value-css-wide + - match: '\b(?:allow-discrete|normal){{b}}' + scope: support.constant.property-value.css + - include: stray-paren-or-semicolon + # CSS Transitions property-transition-delay: - match: \b(transition-delay)\s*(:) From f77361ed430815defa131dc5ec010d6cd541dd55 Mon Sep 17 00:00:00 2001 From: vrugtehagel Date: Sat, 25 May 2024 11:15:56 +0200 Subject: [PATCH 2/2] Add completions and include it to be highlighted --- CSS3.sublime-syntax | 1 + completions/properties.py | 2 ++ test/property-list.css | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/CSS3.sublime-syntax b/CSS3.sublime-syntax index e940f47..a9e313b 100644 --- a/CSS3.sublime-syntax +++ b/CSS3.sublime-syntax @@ -4037,6 +4037,7 @@ contexts: - include: property-transform-box - include: property-transform-origin - include: property-transform-style + - include: property-transition-behavior - include: property-transition-delay - include: property-transition-duration - include: property-transition-property diff --git a/completions/properties.py b/completions/properties.py index 8fc8610..1b72a5f 100644 --- a/completions/properties.py +++ b/completions/properties.py @@ -511,6 +511,7 @@ ("transform-origin", "transform-origin: ${1};"), ("transform-style", "transform-style: ${1};"), ("transition", "transition: ${1};"), + ("transition-behavior", "transition-behavior: ${1};"), ("transition-delay", "transition-delay: ${1};"), ("transition-duration", "transition-duration: ${1};"), ("transition-property", "transition-property: ${1};"), @@ -1667,6 +1668,7 @@ "transform-origin": t.position, "transform-style": [("flat",), ("preserve-3d",)], "transition": t.single_transition, + "transition-behavior": [("allow-discrete",), ("normal",)], "transition-delay": t.time, "transition-duration": t.time, "transition-property": [("all",), ("none",), t.identifier], diff --git a/test/property-list.css b/test/property-list.css index e9b8233..8a6ec06 100644 --- a/test/property-list.css +++ b/test/property-list.css @@ -6280,6 +6280,12 @@ -webkit-transition: background-color linear 1s; -webkit-transition: unset; + transition-behavior: initial; + transition-behavior: inherit; + transition-behavior: unset; + transition-behavior: allow-discrete; + transition-behavior: normal; + transition-delay: initial; transition-delay: inherit; transition-delay: unset;