Skip to content

Commit dda40d9

Browse files
author
meri
committed
Added tests for extend issues found in less.js database. #151
1 parent e43684a commit dda40d9

File tree

6 files changed

+145
-14
lines changed

6 files changed

+145
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.header .header-nav,
2+
.footer .footer-nav {
3+
background: red;
4+
}
5+
.header .header-nav:before,
6+
.footer .footer-nav:before {
7+
background: blue;
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.header {
2+
.header-nav {
3+
background: red;
4+
&:before {
5+
background: blue;
6+
}
7+
}
8+
}
9+
.footer {
10+
.footer-nav {
11+
&:extend( .header .header-nav all );
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.large .error,
2+
.large .badError {
3+
font-size: 200%;
4+
}
5+
.box,
6+
.important,
7+
.success {
8+
margin: 0 auto 25px;
9+
border: 1px solid;
10+
padding: 15px;
11+
border-radius: 6px;
12+
}
13+
.important,
14+
.success {
15+
background: #ffe5e5;
16+
border-color: red;
17+
}
18+
.header .header-nav,
19+
.footer .footer-nav {
20+
background: red;
21+
}
22+
.header .header-nav:before,
23+
.footer .footer-nav:before {
24+
background: blue;
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// https://github.com/less/less.js/issues/1207
2+
.badError:extend(.error all) { }
3+
.large {
4+
.error {
5+
font-size: 200%;
6+
}
7+
}
8+
9+
// https://github.com/less/less.js/issues/1581
10+
.box{
11+
margin: 0 auto 25px;
12+
border: 1px solid;
13+
padding: 15px;
14+
border-radius: 6px;
15+
16+
}
17+
18+
.important{
19+
&:extend(.box all);
20+
background: #ffe5e5;
21+
border-color: red;
22+
}
23+
.success{
24+
&:extend(.important all);
25+
}
26+
27+
// https://github.com/less/less.js/issues/1404
28+
.header {
29+
.header-nav {
30+
background: red;
31+
&:before {
32+
background: blue;
33+
}
34+
}
35+
}
36+
.footer {
37+
.footer-nav {
38+
&:extend( .header .header-nav all );
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.foo {
2+
property: value;
3+
}
4+
.foo.bar,
5+
.foo.baz {
6+
property: value;
7+
}
8+
.foo.baz {
9+
property: value;
10+
}
11+
.button,
12+
.submit {
13+
color: black;
14+
}
15+
.button:hover,
16+
.submit:hover {
17+
color: white;
18+
}
19+
.class,
20+
.other,
21+
.extension {
22+
property: value;
23+
}
24+
.class .class,
25+
.class .other,
26+
.class .extension,
27+
.extension .class,
28+
.extension .other,
29+
.extension .extension {
30+
property: value;
31+
}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
1-
// https://github.com/less/less.js/issues/1581
2-
.box {
3-
margin: 0 auto 25px;
4-
border: 1px solid;
5-
padding: 15px;
6-
border-radius: 6px;
7-
}
1+
// FAILS - OPEN in less.js https://github.com/less/less.js/issues/1554.foo {
2+
property: value;
3+
4+
&.bar {
5+
property: value;
6+
}
7+
8+
&.baz {
9+
&:extend(&.bar);
10+
property: value;
11+
}
812

9-
.important {
10-
&:extend (.box all);
11-
background: #ffe5e5;
12-
border-color: red;
13+
}
14+
// FAILS - https://github.com/less/less.js/issues/1227
15+
.button {
16+
color: black;
17+
&:hover {
18+
color: white;
19+
}
20+
}
21+
.submit {
22+
&:extend(.button);
23+
&:hover:extend(.button:hover) {}
1324
}
1425

15-
.success {
16-
&:extend (.important all);
17-
}
26+
// FAILS - OPEN in less.js https://github.com/less/less.js/issues/1487
27+
.class, .other { property: value }
28+
.class {
29+
.class, .other { property: value }
30+
}
31+
.extension { &:extend(.class all); }

0 commit comments

Comments
 (0)