text/less;text/x-less
*.less
//
/*
*/
[a-z0-9_\x{80}-\x{10ffff}\\-]
[\w-]+
;|(?=})
@\%{identifier}
@{
}
@@\%{identifier}
\$\%{identifier}
@arguments\%]
@{arguments}
(
[+*/] |
(?<! \%{css:single-identifier-char} )
-
(?! \%{css:single-identifier-char} )
)
true
~"
"
~'
'
{
}
\)
@\%{identifier}\(
\%{statement-end}
\(
\)
\(
\)
%\(
\)
url\(
\)
(?(DEFINE)
(?<escape_comment_start> (?: \\ /[/*] )+ )
(?<escape> (?: \\ . )+ )
(?<escape_not_interpolation_start> (?: \\ (?! @{ ) . )+ )
(?<interpolation_start_chars>
(?: (?: @ (?! { ) )+ | (?: (?<! @ ) { )+ )
)
(?<comment_start_chars>
(?: (?: (?<! / ) / (?! [/*] ) )+ | (?: (?<! / ) \* )+ )
)
(?<comment_end_chars>
(?: (?: \* (?! / ) )+ | (?: (?<! \* ) / )+ )
)
(?<single_line_comment> // .* )
(?<interpolation> # recursive subpattern to find matching braces
@{
(?:
(?>
(?:
[^}@{]+ |
# no escapes
(?&interpolation_start_chars)
)+
) |
(?&interpolation)
)*
}
)
(?<parentheses> # recursive subpattern to find matching parentheses
\(
(?:
(?>
(?:
[^\\)(/*"']+ |
(?&escape_comment_start) |
(?&escape) |
(?&comment_start_chars)
)+
) |
(?&parentheses) |
(?&single_line_comment) |
(?&multiline_comment) |
(?&double_quote_string) |
(?&single_quote_string)
)*
\)
)
(?<multiline_comment> # subpattern to find matching comment delimiters
/\*
(?:
(?>
(?:
[^*/]+ |
# no escapes
(?&comment_end_chars)
)+
)
)*
\*/
)
(?<double_quote_string> # subpattern to find matching double quotes
"
(?:
(?>
(?:
[^\\"@{]+ |
(?&escape_not_interpolation_start) |
(?&interpolation_start_chars)
)+
) |
(?&interpolation)
)*
"
)
(?<single_quote_string> # subpattern to find matching single quotes
'
(?:
(?>
(?:
[^\\'@{]+ |
(?&escape_not_interpolation_start) |
(?&interpolation_start_chars)
)+
) |
(?&interpolation)
)*
'
)
)
(
\+_?: | # property merge
:
(?:
(?! # not the start of a
\%{css:single-identifier-char} | # pseudo-class
[:\\] | # pseudo-element, escape
@{ | # variable interpolation
/\* # comment
) | # or
(?= # ends like a normal declaration
(?:
(?>
(?:
[^\\;}{(/*"']+ |
(?&escape_comment_start) |
(?&escape) |
(?&comment_start_chars)
)+
) |
(?&parentheses) |
(?&single_line_comment) |
(?&multiline_comment) |
(?&double_quote_string) |
(?&single_quote_string)
)*
\%{css:declaration-value-end} # with a semicolon or at the end of a block
)
)
)
\%{css:declaration-value-end}
(?<=@plugin)\s*(\()
\)
@plugin\%]
(?=\%{identifier}\()
\%{statement-end}
@charset\%]
css
inline
less
multiple
once
optional
reference
(?<=@import)\s*(\()
\)
@import\%]
\.\.\.
\(
\)
and
not
or
(>=?|=<?|<)
\(
\)
\%[when\%]
(?={)
(&)(\%{css:identifier-chars}?)
(?<=})\%{css:identifier-chars}
all
\%[extend\(
\)