Commit | Line | Data |
---|---|---|
77b7b761 | 1 | (function() { |
837afb80 | 2 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); |
77b7b761 TD |
3 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } |
4 | ||
5 | MT('url_with_quotation', | |
837afb80 | 6 | "[tag foo] { [property background]:[atom url]([string test.jpg]) }"); |
77b7b761 TD |
7 | |
8 | MT('url_with_double_quotes', | |
837afb80 | 9 | "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }"); |
77b7b761 TD |
10 | |
11 | MT('url_with_single_quotes', | |
837afb80 | 12 | "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }"); |
77b7b761 TD |
13 | |
14 | MT('string', | |
15 | "[def @import] [string \"compass/css3\"]"); | |
16 | ||
17 | MT('important_keyword', | |
837afb80 | 18 | "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }"); |
77b7b761 TD |
19 | |
20 | MT('variable', | |
837afb80 | 21 | "[variable-2 $blue]:[atom #333]"); |
77b7b761 TD |
22 | |
23 | MT('variable_as_attribute', | |
837afb80 | 24 | "[tag foo] { [property color]:[variable-2 $blue] }"); |
77b7b761 TD |
25 | |
26 | MT('numbers', | |
837afb80 | 27 | "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"); |
77b7b761 TD |
28 | |
29 | MT('number_percentage', | |
837afb80 | 30 | "[tag foo] { [property width]:[number 80%] }"); |
77b7b761 TD |
31 | |
32 | MT('selector', | |
33 | "[builtin #hello][qualifier .world]{}"); | |
34 | ||
35 | MT('singleline_comment', | |
36 | "[comment // this is a comment]"); | |
37 | ||
38 | MT('multiline_comment', | |
39 | "[comment /*foobar*/]"); | |
40 | ||
41 | MT('attribute_with_hyphen', | |
837afb80 | 42 | "[tag foo] { [property font-size]:[number 10px] }"); |
77b7b761 TD |
43 | |
44 | MT('string_after_attribute', | |
837afb80 | 45 | "[tag foo] { [property content]:[string \"::\"] }"); |
77b7b761 TD |
46 | |
47 | MT('directives', | |
48 | "[def @include] [qualifier .mixin]"); | |
49 | ||
50 | MT('basic_structure', | |
837afb80 | 51 | "[tag p] { [property background]:[keyword red]; }"); |
77b7b761 TD |
52 | |
53 | MT('nested_structure', | |
837afb80 | 54 | "[tag p] { [tag a] { [property color]:[keyword red]; } }"); |
77b7b761 TD |
55 | |
56 | MT('mixin', | |
57 | "[def @mixin] [tag table-base] {}"); | |
58 | ||
59 | MT('number_without_semicolon', | |
837afb80 TD |
60 | "[tag p] {[property width]:[number 12]}", |
61 | "[tag a] {[property color]:[keyword red];}"); | |
77b7b761 TD |
62 | |
63 | MT('atom_in_nested_block', | |
837afb80 | 64 | "[tag p] { [tag a] { [property color]:[atom #000]; } }"); |
77b7b761 TD |
65 | |
66 | MT('interpolation_in_property', | |
837afb80 | 67 | "[tag foo] { #{[variable-2 $hello]}:[number 2]; }"); |
77b7b761 TD |
68 | |
69 | MT('interpolation_in_selector', | |
837afb80 | 70 | "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"); |
77b7b761 TD |
71 | |
72 | MT('interpolation_error', | |
837afb80 | 73 | "[tag foo]#{[error foo]} { [property color]:[atom #000]; }"); |
77b7b761 TD |
74 | |
75 | MT("divide_operator", | |
837afb80 | 76 | "[tag foo] { [property width]:[number 4] [operator /] [number 2] }"); |
77b7b761 TD |
77 | |
78 | MT('nested_structure_with_id_selector', | |
837afb80 TD |
79 | "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"); |
80 | ||
81 | MT('indent_mixin', | |
82 | "[def @mixin] [tag container] (", | |
83 | " [variable-2 $a]: [number 10],", | |
84 | " [variable-2 $b]: [number 10])", | |
85 | "{}"); | |
86 | ||
87 | MT('indent_nested', | |
88 | "[tag foo] {", | |
89 | " [tag bar] {", | |
90 | " }", | |
91 | "}"); | |
92 | ||
93 | MT('indent_parentheses', | |
94 | "[tag foo] {", | |
95 | " [property color]: [variable darken]([variable-2 $blue],", | |
96 | " [number 9%]);", | |
97 | "}"); | |
98 | ||
99 | MT('indent_vardef', | |
100 | "[variable-2 $name]:", | |
101 | " [string 'val'];", | |
102 | "[tag tag] {", | |
103 | " [tag inner] {", | |
104 | " [property margin]: [number 3px];", | |
105 | " }", | |
106 | "}"); | |
77b7b761 | 107 | })(); |