text/less;text/x-less
*.less
//
/*
*/
[^\x{0}-\x{2C}\x{2E}\x{2F}\x{3A}-\x{40}\x{5B}\x{5D}\x{5E}\x{60}\x{7B}-\x{7F}]
[\w-]+
;|(?=})
@\%{identifier}
@{
}
@@\%{identifier}
\$\%{identifier}
@arguments \%{css:keyword-end}
@{arguments}
[+*/] |
(?<! \%{css:keyword-code-point} )
-
(?! \%{css:keyword-code-point} )
\%{css:keyword-start}
\%{css:keyword-end}
true
~"
"
~'
'
{
}
\)
@\%{identifier}\(
\%{statement-end}
\(
\)
\(
\)
%\(
\)
\%{css:keyword-start} 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:keyword-code-point} | # 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 \%{css:keyword-end}
\%{css:keyword-start} (?= \%{identifier} \( )
\%{statement-end}
@charset \%{css:keyword-end}
\%{css:keyword-start}
\%{css:keyword-end}
css
inline
less
multiple
once
optional
reference
(?<=@import)\s*(\()
\)
@import \%{css:keyword-end}
\.\.\.
\(
\)
\%{css:keyword-start}
\%{css:keyword-end}
and
not
or
>=?|=<?|<
\(
\)
\%{css:keyword-start} when \%{css:keyword-end}
(?={)
(&)(\%{css:identifier-chars}?)
(?<=})\%{css:identifier-chars}
\%{css:keyword-start}
\%{css:keyword-end}
all
\%{css:keyword-start} extend \(
\)
(?=&:extend\()
\%{statement-end}