Skip to content

Commit

Permalink
Scheme: Remove blend() matching
Browse files Browse the repository at this point in the history
Was integrated into the core CSS syntax with sublimehq/Packages#2700.

Doesn't support our nested modified `var` highlighting, but that can be
tackled later with a custom syntax that extends CSS.

Closes #324
  • Loading branch information
FichteFoll committed Mar 6, 2022
1 parent 65d9729 commit 9232f5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ contexts:
# https://www.sublimetext.com/docs/minihtml.html#css:ver-dev
- include: color-var-function
- include: color-min-contrast-function
- include: color-blend-function
# Adjusters may be used directly (#327)
- include: CSS.sublime-syntax#color-adjuster-functions

Expand All @@ -408,27 +407,6 @@ contexts:
- match: (?=")
pop: true

color-blend-function:
# Different syntax
- match: \b(?i:blenda?)(?=\()
scope: meta.function-call.identifier.css support.function.color.css
push:
- meta_scope: meta.function-call.blend.css
- match: \(
scope: punctuation.section.group.begin.css
set:
- meta_scope: meta.function-call.arguments.css meta.group.css
- match: (?=") # embed this here so we don't have to "with_prototype"
pop: true
- include: color-var-function
- include: CSS.sublime-syntax#function-arguments-common # matches 'var' function
- include: CSS.sublime-syntax#color-values
- include: CSS.sublime-syntax#percentage-constants
- match: \b(?i:rgb|hsl|hwb)\b
scope: keyword.other.color-space.css
- match: (?=")
pop: true

color-var-function:
# Supports identifiers without leading `--`
- match: \b(?i:var)(?=\()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
// ^^^ support.function.var.css
// ^^^^^^^^^^^^^^^^^ variable.other.sublime-color-scheme
// ^ punctuation.definition.string.end.json
"foreground": "blend(hsl(219, 10%, 6%) 50%)",
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.json string.quoted.double.json meta.color.sublime-color-scheme
// ^ punctuation.definition.string.begin.json
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.css-color meta.function-call
// ^^^^^^^^^^^^^^^^^ meta.function-call meta.function-call
"foreground": "color(var(color_radical_red) tint(20%))",
// ^^^^^^^^^^^^^^^^^ variable.other.sublime-color-scheme
"foreground": "#F8F8F0",
Expand Down

0 comments on commit 9232f5c

Please sign in to comment.