Skip to content

Commit e4dac61

Browse files
committed
Account for CSS update
1 parent a2a94ed commit e4dac61

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

extensions/custom_templates/custom_templates.syntax-extension

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ contexts:
8888

8989
styled-component-keyframes-end:
9090
- !with
91-
- include: scope:source.js.css#at-keyframe-block-content
91+
- include: scope:source.js.css#styled-components-keyframe-body
9292
- !include_resource Packages/JSCustom/extensions/custom_templates/template.yaml
9393
- include: else-pop
9494

styled_components/Styled Components.sublime-syntax

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ contexts:
1010
main:
1111
- meta_prepend: true
1212
- match: (?=(?:{{html_tags}}|{{svg_tags}})(?!:))
13-
push: selector-content
13+
push: styled-components-selector-body
1414
- include: property-identifiers
1515
- include: property-values
1616

1717
rule-list-body:
18+
- meta_prepend: true
1819
- include: main
1920

2021
comments:
@@ -29,9 +30,31 @@ contexts:
2930
selectors:
3031
- meta_prepend: true
3132
- match: (?=&)
32-
push: selector-content
33+
push: styled-components-selector-body
34+
35+
selector-body:
36+
- meta_prepend: true
37+
- match: \&
38+
scope: variable.language.css.styled-components
3339

3440
selector-content:
3541
- meta_prepend: true
3642
- match: \&
3743
scope: variable.language.css.styled-components
44+
45+
# Make sure that we handle both the old and new CSS context names
46+
styled-components-selector-body:
47+
- meta_scope: meta.selector.css
48+
- include: selector-body
49+
- include: selector-content
50+
51+
at-keyframe-block-body:
52+
- meta_prepend: true
53+
54+
at-keyframe-block-content:
55+
- meta_prepend: true
56+
57+
styled-components-keyframe-body:
58+
- meta_scope: meta.at-rule.keyframe.css
59+
- include: at-keyframe-block-body
60+
- include: at-keyframe-block-content

0 commit comments

Comments
 (0)