10000 Merge branch 'master' of github.com:cloudhead/less.js · rusongyu/less.js@c56ab0a · GitHub
[go: up one dir, main page]

Skip to content

Commit c56ab0a

Browse files
committed
Merge branch 'master' of github.com:cloudhead/less.js
2 parents ad12a98 + 5c52f45 commit c56ab0a

File tree

12 files changed

+44
-16
lines changed

12 files changed

+44
-16
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ less:
2727
@@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST}
2828
@@echo "(function (window, undefined) {" >> ${DIST}
2929
@@cat build/require.js\
30+
build/amd.js\
3031
build/ecma-5.js\
3132
${SRC}/parser.js\
3233
${SRC}/functions.js\

build/amd.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// amd.js
2+
//
3+
// Define Less as an AMD module.
4+
if (typeof define === "function" && define.amd) {
5+
define("less", [], function () { return less; } );
6+
}

lib/less/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ if (less.mode === 'browser' || less.mode === 'rhino') {
12551255
// Used by `@import` directives
12561256
//
12571257
less.Parser.importer = function (path, paths, callback, env) {
1258-
if (path.charAt(0) !== '/' && paths.length > 0) {
1258+
if (!/^([a-z]+:)?\//.test(path) && paths.length > 0) {
12591259
path = paths[0] + path;
12601260
}
12611261
// We pass `true` as 3rd argument, to force the reload of the import.

lib/less/tree/ruleset.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ tree.Ruleset.prototype = {
162162
return p.map(function (s) {
163163
return s.toCSS(env);
164164
}).join('').trim();
165-
}).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
165+
}).join( env.compress ? ',' : ',\n');
166+
166167
css.push(selector,
167168
(env.compress ? '{' : ' {\n ') +
168169
rules.join(env.compress ? '' : '\n ') +

test/css/comments.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
color: grey;
4545
}
4646
*/
47-
.selector, .lots, .comments {
47+
.selector,
48+
.lots,
49+
.comments {
4850
color: #808080, /* blue */ #ffa500;
4951
-webkit-border-radius: 2px /* webkit only */;
5052
-moz-border-radius: 8px /* moz only with operation */;

test/css/css-3.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ ul.comma > li:not(:only-child)::after {
2525
ol.comma > li:nth-last-child(2)::after {
2626
color: white;
2727
}
28-
li:nth-child(4n+1), li:nth-child(-5n), li:nth-child(-n+2) {
28+
li:nth-child(4n+1),
29+
li:nth-child(-5n),
30+
li:nth-child(-n+2) {
2931
color: white;
3032
}
3133
a[href^="http://"] {

test/css/css.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ div {
88
* {
99
min-width: 45em;
1010
}
11-
h1, h2 > a > p, h3 {
11+
h1,
12+
h2 > a > p,
13+
h3 {
1214
color: none;
1315
}
1416
div.class {
@@ -33,10 +35,12 @@ div#id {
3335
font-family: 'Garamond Pro';
3436
src: url("/fonts/garamond-pro.ttf");
3537
}
36-
a:hover, a:link {
38+
a:hover,
39+
a:link {
3740
color: #999;
3841
}
39-
p, p:first-child {
42+
p,
43+
p:first-child {
4044
text-transform: none;
4145
}
4246
q:lang(no) {

test/css/media.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
.class .sub {
66
width: 42;
77
}
8-
.top, header > h1 {
8+
.top,
9+
header > h1 {
910
color: #444444;
1011
}
1112
}

test/css/mixins.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
.direct {
4949
border-style: dotted;
5050
}
51-
.bo, .bar {
51+
.bo,
52+
.bar {
5253
width: 100%;
5354
}
5455
.bo {

test/css/rulesets.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#first > .one > #second .two > #deux #third:focus #fifth > #sixth .seventh #eighth + #ninth {
1414
color: purple;
1515
}
16-
#first > .one > #second .two > #deux #fourth, #first > .one > #second .two > #deux #five, #first > .one > #second .two > #deux #six {
16+
#first > .one > #second .two > #deux #fourth,
17+
#first > .one > #second .two > #deux #five,
18+
#first > .one > #second .two > #deux #six {
1719
color: #110000;
1820
}
1921
#first > .one > #second .two > #deux #fourth .seven,
@@ -24,6 +26,8 @@
2426
#first > .one > #second .two > #deux #six .eight > #nine {
2527
border: 1px solid black;
2628
}
27-
#first > .one > #second .two > #deux #fourth #ten, #first > .one > #second .two > #deux #five #ten, #first > .one > #second .two > #deux #six #ten {
29+
#first > .one > #second .two > #deux #fourth #ten,
30+
#first > .one > #second .two > #deux #five #ten,
31+
#first > .one > #second .two > #deux #six #ten {
2832
color: red;
2933
}

test/css/selectors.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ td {
2727
margin: 0;
2828
padding: 0;
2929
}
30-
td, input {
30+
td,
31+
input {
3132
line-height: 1em;
3233
}
3334
a {
@@ -42,12 +43,15 @@ div a {
4243
p a span {
4344
color: yellow;
4445
}
45-
.foo .bar .qux, .foo .baz .qux {
46+
.foo .bar .qux,
47+
.foo .baz .qux {
4648
display: block;
4749
}
48-
.qux .foo .bar, .qux .foo .baz {
50+
.qux .foo .bar,
51+
.qux .foo .baz {
4952
display: inline;
5053
}
51-
.qux .foo .bar .biz, .qux .foo .baz .biz {
54+
.qux .foo .bar .biz,
55+
.qux .foo .baz .biz {
5256
display: none;
5357
}

test/css/whitespace.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
.whitespace {
1414
color: white ;
1515
}
16-
.white, .space, .mania {
16+
.white,
17+
.space,
18+
.mania {
1719
color: white;
1820
}
1921
.no-semi-column {

0 commit comments

Comments
 (0)
0