test files, from less.rb

This commit is contained in:
cloudhead 2010-02-23 18:02:00 -05:00
parent 1d1d40b353
commit 70e6523db4
53 changed files with 27027 additions and 0 deletions

1332
test/big.less Normal file

File diff suppressed because it is too large Load Diff

18
test/css/accessors.css Normal file
View File

@ -0,0 +1,18 @@
.magic-box {
content: "gold";
width: 60cm;
height: 40cm;
}
.magic-box #lock { color: silver; }
#accessors {
content: "gold";
width: 60cm;
}
.unlock {
content: "gold";
width: 60cm;
height: 40cm;
color: silver;
border-color: orange;
}
.unlock #lock { color: silver; }

3768
test/css/big.css Normal file

File diff suppressed because it is too large Load Diff

14
test/css/colors.css Normal file
View File

@ -0,0 +1,14 @@
#yelow #short { color: #ffeeaa; }
#yelow #long { color: #ffeeaa; }
#yelow #rgba { color: rgba(255, 238, 170, 0.1); }
#blue #short { color: #0000ff; }
#blue #long { color: #0000ff; }
#blue #rgba { color: rgba(0, 0, 255, 0.1); }
#overflow .a { color: #000000; }
#overflow .b { color: #ffffff; }
#overflow .c { color: #ffffff; }
#overflow .d { color: #00ff00; }
#grey {
color: #c8c8c8;
background-color: #323232;
}

9
test/css/comments.css Normal file
View File

@ -0,0 +1,9 @@
#comments {
color: red;
background-color: orange;
font-size: 12px;
content: "content";
border: 1px solid black;
padding: 0;
margin: 2em;
}

20
test/css/css-3.css Normal file
View File

@ -0,0 +1,20 @@
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, 0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
}
@font-face {
font-family: Headline;
src: local(Futura-Medium), url(fonts.svg#MyGeometricModern) format("svg");
}
.other { -moz-transform: translate(0, 11em) rotate(-90deg); }
p:not([class*="lead"]) { color: black; }
input[type="text"].class#id[attr=32]:not(1) { color: white; }
div#id.class[a=1][b=2].class:not(1) { color: white; }
ul.comma > li:not(:only-child)::after { color: white; }
ol.comma > li:nth-last-child(2)::after { color: white; }
li:nth-child(4n+1) { color: white; }
li:nth-child(-5n) { color: white; }
li:nth-child(-n+2) { color: white; }
a[href^="http://"], a[href$="http://"] { color: black; }
p::before { color: black; }

50
test/css/css.css Normal file
View File

@ -0,0 +1,50 @@
div { color: black; }
div { width: 99%; }
* { min-width: 45em; }
h1 { color: none; }
h2 > a > p { color: none; }
h3 { color: none; }
div.class { color: blue; }
div#id { color: green; }
.class#id { color: purple; }
.one.two.three { color: grey; }
@media print { font-size: 3em; }
@media screen { font-size: 10px; }
@font-face {
font-family: 'Garamond Pro';
src: url("/fonts/garamond-pro.ttf");
}
a:hover { color: #999999; }
a:link { color: #999999; }
p { text-transform: none; }
p:first-child { text-transform: none; }
q:lang(no) { quotes: none; }
p + h1 { font-size: 2.2em; }
input[type="text"] { font-weight: normal; }
h2[title] { font-size: 100%; }
[disabled] { color: transparent; }
#shorthands {
border: 1px solid #000000;
font: 12px/16px Arial;
margin: 1px 0;
padding: 0 auto;
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#more-shorthands {
margin: 0;
padding: 1px 0 2px 0;
font: normal small/20px 'Trebuchet MS', Verdana, sans-serif;
}
.misc {
-moz-border-radius: 2px;
display: -moz-inline-stack;
width: 0.1em;
background-color: #009998;
background-image: url(images/image.jpg);
background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
}
#important {
color: red !important;
width: 100% !important;
height: 20px ! important;
}

6
test/css/functions.css Normal file
View File

@ -0,0 +1,6 @@
#functions {
color: #999999;
width: 16;
height: undefined("self");
border-width: 5;
}

12
test/css/import.css vendored Normal file
View File

@ -0,0 +1,12 @@
#css { color: yellow; }
#import { color: red; }
.mixin {
height: 10px;
color: red;
}
#import-test {
height: 10px;
color: red;
width: 10px;
height: 30%;
}

1
test/css/lazy-eval.css Normal file
View File

@ -0,0 +1 @@
.lazy-eval { width: 100%; }

32
test/css/mixins-args.css Normal file
View File

@ -0,0 +1,32 @@
.two-args {
color: blue;
width: 10px;
height: 99%;
}
.one-arg {
width: 15px;
height: 49%;
}
.no-parens {
width: 5px;
height: 49%;
}
.no-args {
width: 5px;
height: 49%;
}
.var-args {
width: 45;
height: 17%;
}
.multi-mix {
width: 10px;
height: 29%;
margin: 4;
padding: 5;
}
body {
padding: 30px;
color: #ff0000;
}
.scope-mix { width: 8; }

28
test/css/mixins.css Normal file
View File

@ -0,0 +1,28 @@
.mixin { border: 1px solid black; }
.mixout { border-color: orange; }
.borders { border-style: dashed; }
#namespace .borders { border-style: dotted; }
#namespace .biohazard { content: "death"; }
#namespace .biohazard .man { color: transparent; }
#theme > .mixin { background-color: grey; }
#container {
color: black;
border: 1px solid black;
border-color: orange;
background-color: grey;
}
#header .milk {
color: white;
border: 1px solid black;
background-color: grey;
}
#header #cookie { border-style: dashed; }
#header #cookie .chips { border-style: dotted; }
#header #cookie .chips .calories {
color: black;
border: 1px solid black;
border-color: orange;
background-color: grey;
}
.secure-zone { color: transparent; }
.direct { border-style: dotted; }

28
test/css/operations.css Normal file
View File

@ -0,0 +1,28 @@
#operations {
color: #111111;
height: 9px;
width: 3em;
}
#operations .spacing {
height: 9px;
width: 3em;
}
.with-variables {
height: 16em;
width: 24em;
size: 1cm;
}
.negative {
height: 0px;
width: 4px;
}
.shorthands { padding: -1px 2px 0 -4px; }
.colors {
color: #112233;
border-color: #334455;
background-color: #000000;
}
.colors .other {
color: #222222;
border-color: #222222;
}

20
test/css/parens.css Normal file
View File

@ -0,0 +1,20 @@
.parens {
border: 2px solid black;
margin: 1px 3px 16 3;
width: 36;
padding: 2px 36px;
}
.more-parens {
padding: 8 4 4 4px;
width: 96;
height: 113;
margin: 12;
}
.nested-parens {
width: 71;
height: 6;
}
.mixed-units {
margin: 2px 4em 1 5pc;
padding: 6px 1em 2px 2;
}

6015
test/css/prod.css Normal file

File diff suppressed because it is too large Load Diff

17
test/css/rulesets.css Normal file
View File

@ -0,0 +1,17 @@
#first > .one { font-size: 2em; }
#first > .one > #second .two > #deux { width: 50%; }
#first > .one > #second .two > #deux #third { height: 100%; }
#first > .one > #second .two > #deux #third:focus { color: black; }
#first > .one > #second .two > #deux #third:focus #fifth > #sixth .seventh #eighth + #ninth { color: purple; }
#first > .one > #second .two > #deux #fourth { color: #110000; }
#first > .one > #second .two > #deux #fourth .seven { border: 1px solid black; }
#first > .one > #second .two > #deux #fourth .eight > #nine { border: 1px solid black; }
#first > .one > #second .two > #deux #fourth #ten { color: red; }
#first > .one > #second .two > #deux #five { color: #110000; }
#first > .one > #second .two > #deux #five .seven { border: 1px solid black; }
#first > .one > #second .two > #deux #five .eight > #nine { border: 1px solid black; }
#first > .one > #second .two > #deux #five #ten { color: red; }
#first > .one > #second .two > #deux #six { color: #110000; }
#first > .one > #second .two > #deux #six .seven { border: 1px solid black; }
#first > .one > #second .two > #deux #six .eight > #nine { border: 1px solid black; }
#first > .one > #second .two > #deux #six #ten { color: red; }

11
test/css/scope.css Normal file
View File

@ -0,0 +1,11 @@
.tiny-scope { color: #998899; }
.scope1 {
color: blue;
border-color: black;
}
.scope1 .scope2 { color: blue; }
.scope1 .scope2 .scope3 {
color: red;
border-color: black;
background-color: white;
}

13
test/css/selectors.css Normal file
View File

@ -0,0 +1,13 @@
h1 a:hover { color: red; }
h1 p:hover { color: red; }
h2 a:hover { color: red; }
h2 p:hover { color: red; }
h3 a:hover { color: red; }
h3 p:hover { color: red; }
#all, #the, #same { color: blue; }
ul, li, div, q, blockquote, textarea { margin: 0; }
td {
margin: 0;
padding: 0;
}
td, input { line-height: 1em; }

12
test/css/strings.css Normal file
View File

@ -0,0 +1,12 @@
#strings {
background-image: url("http://son-of-a-banana.com");
quotes: "~" "~";
content: "#*%:&^,)!.(~*})";
empty: "";
}
#comments { content: "/* hello */ // not-so-secret"; }
#single-quote {
quotes: "'" "'";
content: '""#!&""';
empty: '';
}

7
test/css/variables.css Normal file
View File

@ -0,0 +1,7 @@
.variables { width: 14cm; }
.variables {
height: 24px;
color: #888888;
font-family: "Trebuchet MS", Verdana, sans-serif;
quotes: "~" "~";
}

7
test/css/whitespace.css Normal file
View File

@ -0,0 +1,7 @@
.whitespace, .white, .space, .mania, .no-semi-column { color: white; }
.no-semi-column {
color: white;
white-space: pre;
}
.no-semi-column { border: 2px solid white; }
.newlines { border: 2px solid black; }

20
test/less/accessors.less Normal file
View File

@ -0,0 +1,20 @@
.magic-box {
@trim: orange;
content: "gold";
width: 60cm;
height: 40cm;
#lock {
color: silver;
}
}
#accessors {
content: .magic-box['content']; // "gold"
width: .magic-box['width']; // 60cm
}
.unlock {
.magic-box;
color: #lock['color']; // silver
border-color: .magic-box[@trim]; // orange
}

4810
test/less/big.less Normal file

File diff suppressed because it is too large Load Diff

35
test/less/colors.less Normal file
View File

@ -0,0 +1,35 @@
#yelow {
#short {
color: #fea;
}
#long {
color: #ffeeaa;
}
#rgba {
color: rgba(255, 238, 170, 0.1);
}
}
#blue {
#short {
color: #00f;
}
#long {
color: #0000ff;
}
#rgba {
color: rgba(0, 0, 255, 0.1);
}
}
#overflow {
.a { color: #111111 - #444444; } // #000000
.b { color: #eee + #fff; } // #ffffff
.c { color: #aaa * 3; } // #ffffff
.d { color: #00ee00 + #009900; } // #00ff00
}
#grey {
color: rgb(200, 200, 200);
background-color: hsl(50, 0, 50);
}

46
test/less/comments.less Normal file
View File

@ -0,0 +1,46 @@
/*
* Comment Test
*
* - cloudhead (http://cloudhead.net)
*
*/
////////////////
@var: "content";
////////////////
/* Colors
* ------
* #EDF8FC (background blue)
* #166C89 (darkest blue)
*
* Text:
* #333 (standard text) // A comment within a comment!
* #1F9EC9 (standard link)
*
*/
/* @group Variables
------------------- */
#comments {
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
/* lost comment */ content: @var;
border: 1px solid black;
// padding & margin //
padding: 0;
margin: 2em;
} //
/* commented out
#more-comments {
color: grey;
}
*/
//

51
test/less/css-3.less Normal file
View File

@ -0,0 +1,51 @@
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset,
0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
}
@font-face {
font-family: Headline;
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
.other {
-moz-transform: translate(0, 11em) rotate(-90deg);
}
p:not([class*="lead"]) {
color: black;
}
input[type="text"].class#id[attr=32]:not(1) {
color: white;
}
div#id.class[a=1][b=2].class:not(1) {
color: white;
}
ul.comma > li:not(:only-child)::after {
color: white;
}
ol.comma > li:nth-last-child(2)::after {
color: white;
}
li:nth-child(4n+1),
li:nth-child(-5n),
li:nth-child(-n+2) {
color: white;
}
a[href^="http://"] {
color: black;
}
a[href$="http://"] {
color: black;
}
p::before {
color: black;
}

104
test/less/css.less Normal file
View File

@ -0,0 +1,104 @@
/*
a CSS File
*/
div { color: black; }
div { width: 99%; }
* {
min-width: 45em;
}
h1, h2 > a > p, h3 {
color: none;
}
div.class {
color: blue;
}
div#id {
color: green;
}
.class#id {
color: purple;
}
.one.two.three {
color: grey;
}
@media print {
font-size: 3em;
}
@media screen {
font-size: 10px;
}
@font-face {
font-family: 'Garamond Pro';
src: url("/fonts/garamond-pro.ttf");
}
a:hover, a:link {
color: #999;
}
p, p:first-child {
text-transform: none;
}
q:lang(no) {
quotes: none;
}
p + h1 {
font-size: 2.2em;
}
input[type="text"] {
font-weight: normal;
}
h2[title] {
font-size: 100%;
}
[disabled] {
color: transparent;
}
#shorthands {
border: 1px solid #000;
font: 12px/16px Arial;
margin: 1px 0;
padding: 0 auto;
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#more-shorthands {
margin: 0;
padding: 1px 0 2px 0;
font: normal small/20px 'Trebuchet MS', Verdana, sans-serif;
}
.misc {
-moz-border-radius: 2px;
display: -moz-inline-stack;
width: .1em;
background-color: #009998;
background-image: url(images/image.jpg);
background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
margin: ;
}
#important {
color: red !important;
width: 100%!important;
height: 20px ! important;
}

View File

@ -0,0 +1,3 @@
#mixed-units-error {
color: 1px + #fff;
}

View File

@ -0,0 +1,3 @@
#name-error {
color: @var;
}

View File

@ -0,0 +1,3 @@
#syntax-error {
color: blue;;
}

6
test/less/functions.less Normal file
View File

@ -0,0 +1,6 @@
#functions {
color: color("evil red"); // #999999
width: increment(15);
height: undefined("self");
border-width: add(2, 3);
}

25
test/less/hidden.less Normal file
View File

@ -0,0 +1,25 @@
.hidden {
color: transparent;
.inside {
width: 0%;
}
};
.fully-hidden {
color: none;
};
.visible {
width: 100%;
.hidden {
color: black;
};
}
.mix {
.hidden;
}
.mix2 {
.visible;
}

8
test/less/import.less vendored Normal file
View File

@ -0,0 +1,8 @@
@import url("import/import-test-a.less");
@import url("import/import-test-a.less");
#import-test {
.mixin;
width: 10px;
height: @a + 10%;
}

View File

@ -0,0 +1,2 @@
@import "import-test-b.less";
@a: 20%;

View File

@ -0,0 +1,8 @@
@import "import-test-c";
@b: 100%;
.mixin {
height: 10px;
color: @c;
}

View File

@ -0,0 +1,7 @@
@import "import-test-d.css";
@c: red;
#import {
color: @c;
}

View File

@ -0,0 +1 @@
#css { color: yellow; }

6
test/less/lazy-eval.less Normal file
View File

@ -0,0 +1,6 @@
@var: @a;
@a: 100%;
.lazy-eval {
width: @var;
}

View File

@ -0,0 +1,11 @@
% {
@var: 2px;
#literal {
width: 2px * 2;
}
@media {
#nested {
color: red;
}
}
}

View File

@ -0,0 +1,59 @@
.mixin (@a: 1px, @b: 50%) {
width: @a * 5;
height: @b - 1%;
}
.mixiny
(@a: 0, @b: 0) {
margin: @a;
padding: @b;
}
.hidden() {
color: transparent;
}
.two-args {
color: blue;
.mixin(2px, 100%);
}
.one-arg {
.mixin(3px);
}
.no-parens {
.mixin;
}
.no-args {
.mixin();
}
.var-args {
@var: 9;
.mixin(@var, @var * 2);
}
.multi-mix {
.mixin(2px, 30%);
.mixiny(4, 5);
}
.maxa(@arg1: 10, @arg2: #f00) {
padding: @arg1 * 2px;
color: @arg2;
}
body {
.maxa(15);
}
@glob: 5;
.global-mixin(@a:2) {
width: @glob + @a;
}
.scope-mix {
.global-mixin(3);
}

43
test/less/mixins.less Normal file
View File

@ -0,0 +1,43 @@
.mixin { border: 1px solid black; }
.mixout { border-color: orange; }
.borders { border-style: dashed; }
#namespace {
.borders {
border-style: dotted;
}
.biohazard {
content: "death";
.man {
color: transparent;
}
}
}
#theme > .mixin {
background-color: grey;
}
#container {
color: black;
.mixin, .mixout;
#theme > .mixin;
}
#header {
.milk {
color: white;
.mixin, #theme > .mixin;
}
#cookie {
.chips {
#namespace .borders;
.calories {
#container;
}
}
.borders;
}
}
.secure-zone { #namespace .biohazard .man; }
.direct {
#namespace > .borders;
}

39
test/less/operations.less Normal file
View File

@ -0,0 +1,39 @@
#operations {
color: #110000 + #000011 + #001100; // #111111
height: 10px / 2px + 6px - 1px * 2; // 9px
width: 2 * 4 - 5em; // 3em
.spacing {
height: 10px / 2px+6px-1px*2;
width: 2 * 4-5em;
}
}
@x: 4;
@y: 12em;
.with-variables {
height: @x + @y; // 16em
width: 12 + @y; // 24em
size: 5cm - @x; // 1cm
}
@z: -2;
.negative {
height: 2px + @z; // 0px
width: 2px - @z; // 4px
}
.shorthands {
padding: -1px 2px 0 -4px; //
}
.colors {
color: #123; // #112233
border-color: #234 + #111111; // #334455
background-color: #222222 - #fff; // #000000
.other {
color: 2 * #111; // #222222
border-color: #333333 / 3 + #111; // #222222
}
}

26
test/less/parens.less Normal file
View File

@ -0,0 +1,26 @@
.parens {
@var: 1px;
border: (@var * 2) solid black;
margin: (@var * 1) (@var + 2) (4 * 4) 3;
width: (6 * 6);
padding: 2px (6px * 6px);
}
.more-parens {
@var: (2 * 2);
padding: (2 * @var) 4 4 (@var * 1px);
width: (@var * @var) * 6;
height: (7 * 7) + (8 * 8);
margin: 4 * (5 + 5) / 2 - (@var * 2);
//margin: (6 * 6)px;
}
.nested-parens {
width: 2 * (4 * (2 + (1 + 6))) - 1;
height: ((2+3)*(2+3) / (9-4)) + 1;
}
.mixed-units {
margin: 2px 4em 1 5pc;
padding: (2px + 4px) 1em 2px 2;
}

2144
test/less/prod.less Normal file

File diff suppressed because one or more lines are too long

30
test/less/rulesets.less Normal file
View File

@ -0,0 +1,30 @@
#first > .one {
> #second .two > #deux {
width: 50%;
#third {
:focus {
color: black;
#fifth {
> #sixth {
.seventh #eighth {
+ #ninth {
color: purple;
}
}
}
}
}
height: 100%;
}
#fourth, #five, #six {
color: #110000;
.seven, .eight > #nine {
border: 1px solid black;
}
#ten {
color: red;
}
}
}
font-size: 2em;
}

32
test/less/scope.less Normal file
View File

@ -0,0 +1,32 @@
@x: blue;
@z: transparent;
@mix: none;
.mixin {
@mix: #989;
}
.tiny-scope {
color: @mix; // #989
.mixin;
}
.scope1 {
@y: orange;
@z: black;
color: @x; // blue
border-color: @z; // black
.hidden {
@x: #131313;
}
.scope2 {
@y: red;
color: @x; // blue
.scope3 {
@local: white;
color: @y; // red
border-color: @z; // black
background-color: @local; // white
}
}
}

24
test/less/selectors.less Normal file
View File

@ -0,0 +1,24 @@
h1, h2, h3 {
a, p {
:hover {
color: red;
}
}
}
#all { color: blue; }
#the { color: blue; }
#same { color: blue; }
ul, li, div, q, blockquote, textarea {
margin: 0;
}
td {
margin: 0;
padding: 0;
}
td, input {
line-height: 1em;
}

14
test/less/strings.less Normal file
View File

@ -0,0 +1,14 @@
#strings {
background-image: url("http://son-of-a-banana.com");
quotes: "~" "~";
content: "#*%:&^,)!.(~*})";
empty: "";
}
#comments {
content: "/* hello */ // not-so-secret";
}
#single-quote {
quotes: "'" "'";
content: '""#!&""';
empty: '';
}

24
test/less/variables.less Normal file
View File

@ -0,0 +1,24 @@
@a: 2;
@x: @a * @a;
@y: @x + 1;
@z: @x * 2 + @y;
.variables {
width: @z + 1cm; // 14cm
}
@b: @a * 10;
@c: #888;
@fonts: "Trebuchet MS", Verdana, sans-serif;
@f: @fonts;
@quotes: "~" "~";
@q: @quotes;
.variables {
height: @b + @x + 0px; // 24px
color: @c;
font-family: @f;
quotes: @q;
}

34
test/less/whitespace.less Normal file
View File

@ -0,0 +1,34 @@
.whitespace
{ color: white; }
.whitespace
{
color: white;
}
.whitespace
{ color: white; }
.whitespace{color:white;}
.whitespace { color : white ; }
.white,
.space,
.mania
{ color: white; }
.no-semi-column { color: white }
.no-semi-column {
color: white;
white-space: pre
}
.no-semi-column {border: 2px solid white}
.newlines {
border: 2px
solid
black;
}
.empty {
}

4
test/op.less Normal file
View File

@ -0,0 +1,4 @@
@import "f";
div {
width: 2 - 5;
}

26
test/spec.less Normal file
View File

@ -0,0 +1,26 @@
@import "lib";
div.browse {
@var: 1px;
margin: 0 0 20px;
&.class {
padding: 0;
}
:hover {
width: @var;
height: 1 + @var;
}
#div {
@poo: #fff;
foo: bar, zoo;
> pipe {
color: @poo;
}
}
> foo {
foo: #444;
}
&:last {
c:1;
}
}

7959
test/test.less Normal file

File diff suppressed because it is too large Load Diff