diff options
Diffstat (limited to 'test/bem/_suffix.scss')
-rw-r--r-- | test/bem/_suffix.scss | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/test/bem/_suffix.scss b/test/bem/_suffix.scss new file mode 100644 index 0000000..34f55b6 --- /dev/null +++ b/test/bem/_suffix.scss | |||
@@ -0,0 +1,97 @@ | |||
1 | // sass-lint:disable class-name-format force-element-nesting force-pseudo-nesting mixins-before-declarations | ||
2 | |||
3 | @use 'true' as *; | ||
4 | @use '../../src/bem'; | ||
5 | |||
6 | // | ||
7 | // Included test cases: | ||
8 | // - /// 1 /// - block suffix | ||
9 | // - /// 2 /// - element suffix | ||
10 | // - /// 3 /// - modifier suffix | ||
11 | // - /// 4 /// - multiple element suffix | ||
12 | // | ||
13 | |||
14 | @include it('suffix') { | ||
15 | @include assert('block suffix') { /// 1 /// | ||
16 | @include output { | ||
17 | @include bem.block('something') { | ||
18 | @include bem.suffix('sm') { | ||
19 | font-size: 1.5em; | ||
20 | } | ||
21 | } | ||
22 | } | ||
23 | |||
24 | @include expect { | ||
25 | .something\@sm { | ||
26 | font-size: 1.5em; | ||
27 | } | ||
28 | } | ||
29 | } | ||
30 | |||
31 | @include assert('element suffix') { /// 2 /// | ||
32 | @include output { | ||
33 | @include bem.block('something') { | ||
34 | @include bem.elem('child') { | ||
35 | @include bem.suffix('sm') { | ||
36 | font-size: 2.5em; | ||
37 | } | ||
38 | } | ||
39 | } | ||
40 | } | ||
41 | |||
42 | @include expect { | ||
43 | .something__child\@sm { | ||
44 | font-size: 2.5em; | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | |||
49 | @include assert('modifier suffix') { /// 3 /// | ||
50 | @include output { | ||
51 | @include bem.block('something') { | ||
52 | @include bem.modifier('mod1') { | ||
53 | @include bem.suffix('sm') { | ||
54 | font-size: 1.75em; | ||
55 | } | ||
56 | } | ||
57 | |||
58 | @include bem.elem('child') { | ||
59 | @include bem.modifier('mod2') { | ||
60 | @include bem.suffix('sm') { | ||
61 | font-size: 2.75em; | ||
62 | } | ||
63 | } | ||
64 | } | ||
65 | } | ||
66 | } | ||
67 | |||
68 | @include expect { | ||
69 | .something--mod1\@sm { | ||
70 | font-size: 1.75em; | ||
71 | } | ||
72 | |||
73 | .something__child--mod2\@sm { | ||
74 | font-size: 2.75em; | ||
75 | } | ||
76 | } | ||
77 | } | ||
78 | |||
79 | @include assert('multiple element suffix') { /// 4 /// | ||
80 | @include output { | ||
81 | @include bem.block('something') { | ||
82 | @include bem.elem('child1', 'child2') { | ||
83 | @include bem.suffix('sm') { | ||
84 | font-size: 2.5em; | ||
85 | } | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | |||
90 | @include expect { | ||
91 | .something__child1\@sm, | ||
92 | .something__child2\@sm { | ||
93 | font-size: 2.5em; | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | } | ||