PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 3.3.8
Pods – Custom Content Types and Fields v3.3.8
trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / ui / js / codemirror / mode / css / less_test.js
pods / ui / js / codemirror / mode / css Last commit date
css.js 2 years ago gss.html 2 years ago gss_test.js 2 years ago index.html 2 years ago less.html 2 years ago less_test.js 2 years ago scss.html 2 years ago scss_test.js 2 years ago test.js 2 years ago
less_test.js
55 lines
1 // CodeMirror, copyright (c) by Marijn Haverbeke and others
2 // Distributed under an MIT license: https://codemirror.net/5/LICENSE
3
4 (function() {
5 "use strict";
6
7 var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less");
8 function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); }
9
10 MT("variable",
11 "[variable-2 @base]: [atom #f04615];",
12 "[qualifier .class] {",
13 " [property width]: [variable&callee percentage]([number 0.5]); [comment // returns `50%`]",
14 " [property color]: [variable&callee saturate]([variable-2 @base], [number 5%]);",
15 "}");
16
17 MT("amp",
18 "[qualifier .child], [qualifier .sibling] {",
19 " [qualifier .parent] [atom &] {",
20 " [property color]: [keyword black];",
21 " }",
22 " [atom &] + [atom &] {",
23 " [property color]: [keyword red];",
24 " }",
25 "}");
26
27 MT("mixin",
28 "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
29 " [property color]: [variable&callee darken]([variable-2 @color], [number 10%]);",
30 "}",
31 "[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
32 " [property color]: [variable&callee lighten]([variable-2 @color], [number 10%]);",
33 "}",
34 "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
35 " [property display]: [atom block];",
36 "}",
37 "[variable-2 @switch]: [variable light];",
38 "[qualifier .class] {",
39 " [qualifier .mixin]([variable-2 @switch]; [atom #888]);",
40 "}");
41
42 MT("nest",
43 "[qualifier .one] {",
44 " [def @media] ([property width]: [number 400px]) {",
45 " [property font-size]: [number 1.2em];",
46 " [def @media] [attribute print] [keyword and] [property color] {",
47 " [property color]: [keyword blue];",
48 " }",
49 " }",
50 "}");
51
52
53 MT("interpolation", ".@{[variable foo]} { [property font-weight]: [atom bold]; }");
54 })();
55