Skip to content

Commit

Permalink
recursive property lists
Browse files Browse the repository at this point in the history
  • Loading branch information
braver committed Jan 29, 2018
1 parent df5a275 commit 987eb72
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
29 changes: 11 additions & 18 deletions LESS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variables:
ident: '(?:--{{nmchar}}+|-?{{nmstart}}{{nmchar}}*)'
contexts:
main:
- include: curlies
- include: property-list
- include: commas
- include: terminator
- include: comment-block
Expand All @@ -42,12 +42,6 @@ contexts:
2: entity.name.namespace.wildcard.css
3: punctuation.separator.namespace.css

curlies:
- match: '\{'
scope: punctuation.section.property-list.begin.css
- match: '\}'
scope: punctuation.section.property-list.end.css

commas:
- match: '\s*(,)\s*'
captures:
Expand Down Expand Up @@ -232,6 +226,15 @@ contexts:
- match: '(-+|_+)[a-zA-Z_][a-zA-Z0-9_-]*'
scope: entity.other.attribute-name.css

property-list:
- match: '\{'
scope: punctuation.section.property-list.begin.css
push:
- match: '\}'
scope: punctuation.section.property-list.end.css
pop: true
- include: main

less-parameters:
- match: '\('
scope: punctuation.section.group.begin.less
Expand All @@ -242,17 +245,7 @@ contexts:
pop: true
- match: ':'
scope: punctuation.separator.key-value.css
- match: '\{'
scope: punctuation.section.property-list.begin.css
push:
- match: '\}'
scope: punctuation.section.property-list.end.css
pop: true
- include: selector
- include: rule-list
- include: less-operators
- include: less-parameters
- include: terminator
- include: property-list
- include: comment-line
- include: comment-block
- include: color-values
Expand Down
11 changes: 11 additions & 0 deletions syntax_test_less.less
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,18 @@ header {
#transition(~'opacity @{duration-short} @{ease}')
/* ^ string.quoted.single.css markup.raw.less keyword.operator.less */
}
.site-header-info-extra-tooltip {
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.selector.css entity.other.attribute-name.class.css */
opacity: 1;
#transition(~'opacity @{duration-short} @{ease}')

.site-header-info-extra-tooltip {
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.selector.css entity.other.attribute-name.class.css */
opacity: 1;
#transition(~'opacity @{duration-short} @{ease}')

}
}
})

.desktop-and-old-ie({
Expand Down

0 comments on commit 987eb72

Please sign in to comment.