Merge branch '2.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / js / 3rdParty / codemirror / mode / css / less_test.js
1 (function() {
2 "use strict";
3
4 var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less");
5 function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); }
6
7 MT("variable",
8 "[variable-2 @base]: [atom #f04615];",
9 "[qualifier .class] {",
10 " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]",
11 " [property color]: [variable saturate]([variable-2 @base], [number 5%]);",
12 "}");
13
14 MT("amp",
15 "[qualifier .child], [qualifier .sibling] {",
16 " [qualifier .parent] [atom &] {",
17 " [property color]: [keyword black];",
18 " }",
19 " [atom &] + [atom &] {",
20 " [property color]: [keyword red];",
21 " }",
22 "}");
23
24 MT("mixin",
25 "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
26 " [property color]: [variable darken]([variable-2 @color], [number 10%]);",
27 "}",
28 "[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
29 " [property color]: [variable lighten]([variable-2 @color], [number 10%]);",
30 "}",
31 "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
32 " [property display]: [atom block];",
33 "}",
34 "[variable-2 @switch]: [variable light];",
35 "[qualifier .class] {",
36 " [qualifier .mixin]([variable-2 @switch]; [atom #888]);",
37 "}");
38
39 MT("nest",
40 "[qualifier .one] {",
41 " [def @media] ([property width]: [number 400px]) {",
42 " [property font-size]: [number 1.2em];",
43 " [def @media] [attribute print] [keyword and] [property color] {",
44 " [property color]: [keyword blue];",
45 " }",
46 " }",
47 "}");
48 })();