Skip to content

Commit

Permalink
Support rulesets in variables + mixins, closes #63
Browse files Browse the repository at this point in the history
  • Loading branch information
danro committed Aug 31, 2014
1 parent c854860 commit ebd4a2f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
6 changes: 3 additions & 3 deletions LESS.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@
<key>less-parameters</key>
<dict>
<key>begin</key>
<string>\(</string>
<string>\(|(}\s*,)</string>
<key>end</key>
<string>\)</string>
<string>\)|{</string>
<key>name</key>
<string>parameter.less</string>
<key>patterns</key>
Expand Down Expand Up @@ -705,7 +705,7 @@
</dict>
</dict>
<key>end</key>
<string>\s*(;|(?=\}))</string>
<string>\s*(;|(?=[{}]))</string>
<key>endCaptures</key>
<dict>
<key>1</key>
Expand Down
6 changes: 3 additions & 3 deletions LESS.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
},
{
"begin" : "(:)\\s*",
"end" : "\\s*(;|(?=\\}))",
"end" : "\\s*(;|(?=[{}]))",
"beginCaptures" : {
"1" : {
"name" : "punctuation.separator.key-value.css"
Expand Down Expand Up @@ -588,8 +588,8 @@
"name" : "meta.at-rule.css"
},
"less-parameters" : {
"begin" : "\\(",
"end" : "\\)",
"begin" : "\\(|(}\\s*,)",
"end" : "\\)|{",
"patterns": [
{
"include" : "#color-values"
Expand Down
37 changes: 36 additions & 1 deletion tests.less
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ body {

.box-shadow(2px, 5px);

.mixin(one, two, 'three', @four) {
.mixin(one, two, 'three', @four, @{five}) {
color: darken(@color, 10%);
}
.mixin(dark, @color) {
Expand Down Expand Up @@ -487,3 +487,38 @@ input {color:green;}
input:before {color:green;}
input::-webkit-input-placeholder {color:red;}
input:-moz-placeholder {color:red;}

//https://github.com/danro/LESS-sublime/issues/63
.test-case {
// This is a comment
font-size: 10px;

.mixin-param-test(100px, {
// This is a comment

.inner-mixin(param, {
// We must go deeper
font-size: 10px;
});

font-size: 10px;
}, param1, @param2, @{param3}, 40px);
}

@my-ruleset: {
.my-selector {
background-color: black;
}
};

@my-ruleset: {
.my-selector {
@media tv {
background-color: black;
}
}
};

@media (orientation:portrait) {
@my-ruleset();
}

0 comments on commit ebd4a2f

Please sign in to comment.