Skip to content

Commit 43a54b3

Browse files
committed
Theme: Support null for color_scheme_tint
Fixes #370
1 parent f787e91 commit 43a54b3

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

Package/Sublime Text Theme/Sublime Text Theme.sublime-syntax

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,15 @@ variables:
2727
| monospace_background_color
2828
| shadow_color
2929
| viewport_color
30-
| color_scheme_tint(?:_2)?
3130
| color\d+
3231
| link_color # from Sublime Merge
3332
| (?:accent_)?tint_modifier
3433
| (?:left|right|top|bottom)_shadow
3534
)
35+
tint_key: |-
36+
(?x:
37+
color_scheme_tint(?:_2)?
38+
)
3639
color_adjuster_key: |-
3740
(?x:
3841
background_modifier # 4095
@@ -254,6 +257,14 @@ contexts:
254257
2: keyword.other.rule.sublime-theme
255258
3: punctuation.definition.string.end.json
256259
set: [expect-color-value, expect-colon]
260+
# tint values
261+
- match: (")({{tint_key}})(")
262+
scope: meta.mapping.key.json meta.rule-key.color.sublime-theme string.quoted.double.json
263+
captures:
264+
1: punctuation.definition.string.begin.json
265+
2: keyword.other.rule.sublime-theme
266+
3: punctuation.definition.string.end.json
267+
set: [expect-tint-value, expect-colon]
257268
# color adjuster values
258269
- match: (")({{color_adjuster_key}})(")
259270
scope: meta.mapping.key.json meta.rule-key.color-adjuster.sublime-theme string.quoted.double.json

Package/Sublime Text Theme/syntax_test_newstyletheme.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,18 @@
123123
// <- invalid.illegal.expected-comma.inside-mapping.json
124124
// ^^^^^^^^^^^^^^^^^^^^^^ meta.rule-key.color.sublime-theme
125125
// ^^^ support.function.var.css
126-
"layer1.tint": null,
127-
// ^^^^ meta.mapping.value.json constant.language.null.json
128126
"layer2.tint": "color(var(--bluish) min-contrast(rgb(235, 237, 239) 2.5))",
129127
// ^^^^^ support.function.color.css
130128
// ^^^ support.function.var.css
131129
// ^^^^^^^^^^^^ support.function.min-contrast.css
132130
// ^^^ support.function.color.css
133131
// ^^^ constant.numeric
132+
},
133+
{ // tints (like colors but support `null`)
134+
"color_scheme_tint": null,
135+
// ^^^^ meta.mapping.value.json constant.language.null.json
136+
"layer1.tint": null,
137+
// ^^^^ meta.mapping.value.json constant.language.null.json
134138
},
135139
{ // color adjusters
136140
"background_modifier": "blend(white 97.5%)"

0 commit comments

Comments
 (0)