Skip to content

Commit

Permalink
always newline selector lists
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Jan 21, 2012
1 parent 90013bc commit 7541907
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 15 deletions.
3 changes: 2 additions & 1 deletion lib/less/tree/ruleset.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ tree.Ruleset.prototype = {
return p.map(function (s) {
return s.toCSS(env);
}).join('').trim();
}).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
}).join( env.compress ? ',' : ',\n');

css.push(selector,
(env.compress ? '{' : ' {\n ') +
rules.join(env.compress ? '' : '\n ') +
Expand Down
4 changes: 3 additions & 1 deletion test/css/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
color: grey;
}
*/
.selector, .lots, .comments {
.selector,
.lots,
.comments {
color: #808080, /* blue */ #ffa500;
-webkit-border-radius: 2px /* webkit only */;
-moz-border-radius: 8px /* moz only with operation */;
Expand Down
4 changes: 3 additions & 1 deletion test/css/css-3.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ ul.comma > li:not(:only-child)::after {
ol.comma > li:nth-last-child(2)::after {
color: white;
}
li:nth-child(4n+1), li:nth-child(-5n), li:nth-child(-n+2) {
li:nth-child(4n+1),
li:nth-child(-5n),
li:nth-child(-n+2) {
color: white;
}
a[href^="http://"] {
Expand Down
10 changes: 7 additions & 3 deletions test/css/css.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ div {
* {
min-width: 45em;
}
h1, h2 > a > p, h3 {
h1,
h2 > a > p,
h3 {
color: none;
}
div.class {
Expand All @@ -33,10 +35,12 @@ div#id {
font-family: 'Garamond Pro';
src: url("/fonts/garamond-pro.ttf");
}
a:hover, a:link {
a:hover,
a:link {
color: #999;
}
p, p:first-child {
p,
p:first-child {
text-transform: none;
}
q:lang(no) {
Expand Down
3 changes: 2 additions & 1 deletion test/css/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
.class .sub {
width: 42;
}
.top, header > h1 {
.top,
header > h1 {
color: #444444;
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/css/mixins.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
.direct {
border-style: dotted;
}
.bo, .bar {
.bo,
.bar {
width: 100%;
}
.bo {
Expand Down
8 changes: 6 additions & 2 deletions test/css/rulesets.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
#first > .one > #second .two > #deux #third:focus #fifth > #sixth .seventh #eighth + #ninth {
color: purple;
}
#first > .one > #second .two > #deux #fourth, #first > .one > #second .two > #deux #five, #first > .one > #second .two > #deux #six {
#first > .one > #second .two > #deux #fourth,
#first > .one > #second .two > #deux #five,
#first > .one > #second .two > #deux #six {
color: #110000;
}
#first > .one > #second .two > #deux #fourth .seven,
Expand All @@ -24,6 +26,8 @@
#first > .one > #second .two > #deux #six .eight > #nine {
border: 1px solid black;
}
#first > .one > #second .two > #deux #fourth #ten, #first > .one > #second .two > #deux #five #ten, #first > .one > #second .two > #deux #six #ten {
#first > .one > #second .two > #deux #fourth #ten,
#first > .one > #second .two > #deux #five #ten,
#first > .one > #second .two > #deux #six #ten {
color: red;
}
12 changes: 8 additions & 4 deletions test/css/selectors.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ td {
margin: 0;
padding: 0;
}
td, input {
td,
input {
line-height: 1em;
}
a {
Expand All @@ -42,12 +43,15 @@ div a {
p a span {
color: yellow;
}
.foo .bar .qux, .foo .baz .qux {
.foo .bar .qux,
.foo .baz .qux {
display: block;
}
.qux .foo .bar, .qux .foo .baz {
.qux .foo .bar,
.qux .foo .baz {
display: inline;
}
.qux .foo .bar .biz, .qux .foo .baz .biz {
.qux .foo .bar .biz,
.qux .foo .baz .biz {
display: none;
}
4 changes: 3 additions & 1 deletion test/css/whitespace.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
.whitespace {
color: white ;
}
.white, .space, .mania {
.white,
.space,
.mania {
color: white;
}
.no-semi-column {
Expand Down

0 comments on commit 7541907

Please sign in to comment.