Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Themes: Add var() function support to color-adjuster context #326

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,10 @@ contexts:
push:
- meta_scope: meta.function-call.min-contrast.css
- match: \)
scope: meta.group.css punctuation.definition.group.end.css
scope: meta.group.css punctuation.section.group.end.css
pop: true
- match: \(
scope: punctuation.definition.group.begin.css
scope: punctuation.section.group.begin.css
push:
- meta_scope: meta.group.css
- match: (?=\))
Expand Down Expand Up @@ -433,11 +433,11 @@ contexts:
push:
- meta_scope: meta.function-call.var.css
- match: \(
scope: punctuation.definition.group.begin.css
scope: punctuation.section.group.begin.css
set:
- meta_scope: meta.function-call.var.css meta.group.css
- match: \)
scope: meta.group.css punctuation.definition.group.end.css
scope: meta.group.css punctuation.section.group.end.css
pop: true
- match: (?:--)?[\w-]+
scope: variable.other.sublime-color-scheme
Expand Down Expand Up @@ -478,6 +478,7 @@ contexts:
- match: $\n?
scope: invalid.illegal.unclosed-string.json
pop: true
- include: color-var-function
- include: CSS.sublime-syntax#color-adjuster-functions

expect-css-string-value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
// ^^^^^^^^^^^^^^^^^^^^^^^ meta.mapping.value.json string.quoted.double.json meta.color.sublime-color-scheme
// ^ punctuation.definition.string.begin.json
// ^^^ support.function.var.css
// ^ punctuation.definition.group.begin.css
// ^ punctuation.section.group.begin.css
// ^^^^^^^^^^^^^^^^ variable.other.sublime-color-scheme
// ^ punctuation.definition.group.end.css
// ^ punctuation.section.group.end.css
// ^ punctuation.definition.string.end.json
// ^ punctuation.separator.mapping.pair.json
"stack_guide": "#9D550FB0",
Expand Down
7 changes: 7 additions & 0 deletions Package/Sublime Text Theme/syntax_test_newstyletheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@
// ^^^^^ support.function.color.css
// ^ punctuation.section.group.begin.css
// ^^^^^ support.constant
"background_modifier": "var(adjuster_variable)"
// ^^^^^^^^^^^^^^^^^^^ meta.rule-key.color-adjuster.sublime-theme string.quoted.double.json keyword.other.rule.sublime-theme
// ^^^^^^^^^^^^^^^^^^^^^^ meta.rule.sublime-theme meta.mapping.value.json string.quoted.double.json meta.color-adjuster.sublime-color-scheme source.css-color-adjuster
// ^^^ support.function.var.css
// ^ punctuation.section.group.begin.css
// ^^^^^^^^^^^^^^^^^ variable.other.sublime-color-scheme
// ^ punctuation.section.group.end.css
},
{ // floats
"line_selection_border_width": "abc" 2.0,
Expand Down