marijnh/CodeMirror — pull request #1856 by peterkroon (2013-10-01 12:31:29+00:00)
Title: [LESS mode] - update highlighting, indentation

Better handling tags:
````
.page {
.content {
width: 870px;
padding: 45px;
}
margin: 0 auto;
font-family: 'Georgia', serif;
font-size: 18px;
line-height: 26px;
padding: 0 60px;
code {
font-size: 16px;
}
pre {
border-width: 1px;
border-style: dashed;
padding: 15px;
margin: 15px 0;
}
h1 {
text-align: left;
font-size: 40px;
margin-top: 15px;
margin-bottom: 35px;
}
p + h1 { margin-top: 60px }
h2, h3 {
margin: 30px 0 15px 0;
}
p + h2, pre + h2, code + h2 {
border-top: 6px solid rgba(255, 255, 255, 0.1);
padding-top: 30px;
}
h3 {
margin: 15px 0;
}
}
````

Better handling of parameters:
````
#menu {
position: absolute;
width: 100%;
z-index: 3;
clear: both;
display: block;
background-color: @blue;
height: 42px;
border-top: 2px solid lighten(@alpha-blue, 20%);
border-bottom: 2px solid darken(@alpha-blue, 25%);
.box-shadow(0, 1px, 8px, 0.6);
-moz-box-shadow: 0 0 0 #000; // Because firefox sucks.

&.docked {
background-color: hsla(210, 60%, 40%, 0.4);
}
&:hover {
background-color: @blue;
}

#dropdown {
margin: 0 0 0 117px;
padding: 0;
padding-top: 5px;
display: none;
width: 190px;
border-top: 2px solid @medium;
color: @highlight;
border: 2px solid darken(@medium, 25%);
border-left-color: darken(@medium, 15%);
border-right-color: darken(@medium, 15%);
border-top-width: 0;
background-color: darken(@medium, 10%);
ul {
padding: 0px;
}
li {
font-size: 14px;
display: block;
text-align: left;
padding: 0;
border: 0;
a {
display: block;
padding: 0px 15px;
text-decoration: none;
color: white;
&:hover {
background-color: darken(@medium, 15%);
text-decoration: none;
}
}
}
.border-radius(5px, bottom);//bottom is now white, not the blue tag
.box-shadow(0, 6px, 8px, 0.5);
}
}
````

Beter handling of attributes:
````
[att^=val]
[att$=val]
[att*=val]

@namespace foo "http://www.example.com";
[foo|att=val] { color: blue }
[*|att] { color: yellow }
[|att] { color: green }
````

Better hanlding of units:
````
@-webkit-keyframes tourbanner {
0% { opacity: .9 }
50% { opacity: .75 }
100% { opacity: .9 }
}
@keyframes tourbanner {
0% { opacity: 1 }
50% { opacity: .75 }
100% { opacity: 1 }
}
````

Better handling of ''n'' of ''-1'':
````
:nth-child( 3n + 1 )
:nth-child( +3n - 2 )
:nth-child( -n+ 6)
:nth-child( +6 )

html|tr:nth-child(-n+6) /* represents the 6 first rows of XHTML tables */

img:nth-of-type(2n+1) { float: right; }
img:nth-of-type(2n) { float: left; }

body > h2:nth-of-type(n+2):nth-last-of-type(n+2)
body > h2:not(:first-of-type):not(:last-of-type)
````

Better handling of the url string:
````
.test {
background: url(example.png#goto12345);//hashtag :-)
background: url(/example.png#foo);
background: url(/example.png)
background: url(example.png);
background: url( exam\)ple.png#foo);
background: url( exam\(ple.png#foo);
background: url(/exam\'pl\(\)e.png );
background: url(/exam\"ple.png#foo );
}
````

Better handling when mostlikely typing a property:
````
#eee aaa .box
{
#test bbb {
width: 500px;
height: 250px;
background-image: url(dir/output/sheep.png), url( betweengrassandsky.png );
background-position: center bottom, left top;
background-repeat: no-repeat;
}
}
````

Overall better colorizing.