Skip to content

Commit

Permalink
Merge pull request #38 from willrowe/hotfix/css-syntax
Browse files Browse the repository at this point in the history
Fix the CSS syntax
  • Loading branch information
braver authored Oct 18, 2024
2 parents 506db5f + c4bfa93 commit 2c3c11c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
18 changes: 18 additions & 0 deletions resources/syntax/CSS (Twig).sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ contexts:
- include: Twig.sublime-syntax#twig_embedded
- include: Twig.sublime-syntax#comment

main:
- meta_prepend: true
- meta_include_prototype: false
- include: Twig.sublime-syntax#twig_embedded
- include: Twig.sublime-syntax#comment

block-end:
- meta_append: true
- include: Twig.sublime-syntax#twig_embedded
- include: Twig.sublime-syntax#comment

at-rule-block-body:
# required until ST4173
- meta_prepend: true
- meta_include_prototype: false
- include: Twig.sublime-syntax#twig_embedded
- include: Twig.sublime-syntax#comment

string-content:
- meta_prepend: true
- include: Twig.sublime-syntax#twig_embedded
22 changes: 22 additions & 0 deletions resources/syntax/tests/syntax_test_css.css.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* SYNTAX TEST "Packages/Twig/resources/syntax/CSS (Twig).sublime-syntax" */

/* Expression */
div {
/* ^^^ meta.selector.css */
/* ^ punctuation.section.block.begin.css */
color: {{ blue|escape }} {# a comment #};
/* ^^^^^^^^^^^^^^^^^ meta.expression.twig */
/* ^^^^^^^^^^^^^^^^^ - meta.property-list.css */
/* ^^^^^^^^^^^^^^^^^ - meta.property-value.css */
/* ^^^^^^^^^^^^^^^ comment.block.twig */
}
/* ^ punctuation.section.block.end.css */

/* Statement */
div {
{% block style %}{% endblock %}
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.statement.twig */

font-size: 24px;
/* ^^^^^^^^^ meta.property-name.css */
}

0 comments on commit 2c3c11c

Please sign in to comment.