Skip to content

Commit

Permalink
@include is syntax highlighted inside blocks { } but a bit broken if …
Browse files Browse the repository at this point in the history
…used in root document.
  • Loading branch information
sfcgeorge committed Jun 30, 2011
1 parent e0964fa commit 520d7b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 45 deletions.
11 changes: 2 additions & 9 deletions SyntaxInjections/EmbeddedTweaks.xml
@@ -1,15 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<injections>
<injection name="injections.properties.css.scss" selector="property-list.block.css *" action="insert-after-children">
<starts-with>
<expression>((@)include)</expression>
<capture number="1" name="keyword.control"/>
<capture number="2" name="punctuation.definition.keyword"/>
</starts-with>
<ends-with>
<expression>(?=\s)</expression>
</ends-with>
<injection name="injections.properties.css.scss" selector="scss property-list.block.css" action="insert-after-children">
<include syntax="language-root.css.scss" collection="at-rule-include"/>
</injection>

<!-- From HTML+XML - reference examples
Expand Down
39 changes: 5 additions & 34 deletions Syntaxes/CSS.xml
Expand Up @@ -5,12 +5,6 @@
<include collection="at-rule-include"/>

<include syntax="language-root.css" />

<zone name="property-list.block.css">
<subzones>
<include collection="at-rule-include"/>
</subzones>
</zone>
</zones>

<library>
Expand All @@ -27,38 +21,15 @@
</zone>
<zone name="property-value">
<starts-with>
<expression>(?=(\s)[:.*#a-zA-Z@\\])</expression>
<capture number="1" name="punctuation.separator.key-value.css"/>
<expression>(\()</expression>
<capture number="1" name="punctuation.section.function.css"/>
</starts-with>
<ends-with>
<expression>\s*(;|(?=\}))</expression>
<capture number="1" name="punctuation.terminator.rule.css"/>
<expression>(\))</expression>
<capture number="1" name="punctuation.section.function.css"/>
</ends-with>
<subzones>
<zone name="support.function.misc.css">
<starts-with>
<expression>([-a-zA-Z])\s*(\()</expression>
<capture number="1" name="name"/>
<capture number="2" name="punctuation.section.function.css"/>
</starts-with>
<ends-with>
<expression>(\))</expression>
<capture number="1" name="punctuation.section.function.css"/>
</ends-with>
<subzones>
<include collection="string-single"/>
<include collection="string-double"/>
<zone name="constant.other.color.rgb-value.css">
<expression>(\b0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*)(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*)(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\b)</expression>
</zone>
<zone name="constant.other.color.rgb-percentage.css">
<expression>\b([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%</expression>
</zone>
<zone name="parameter.misc.css">
<expression>[^'") \t]+</expression>
</zone>
</subzones>
</zone>
<include syntax="language-root.css" collection="property-values"/>
</subzones>
</zone>
</collection>
Expand Down
5 changes: 3 additions & 2 deletions test.scss
@@ -1,11 +1,12 @@
@include mixin();
@include mixin(10px, ghjgjh 'ghj');
@include another_mixin();

#an_id_selector {
-browser-specific: property;
height: 10px;
background-image: url('somewhere');
@include mixin_inside_block();
@include mixin-inside-block(10px, something 'ghjgh' #45f rgb(210, 100, 20));
@include another-mixin;
}

/*comment*/
Expand Down

0 comments on commit 520d7b3

Please sign in to comment.