aboutsummaryrefslogtreecommitdiffstats
path: root/test/bem/_at-theme.scss
blob: 83ea4d16b58f0e113b9beb623812891172e4463f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// sass-lint:disable class-name-format force-element-nesting force-pseudo-nesting mixins-before-declarations

@use 'true' as *;
@use '../../src/bem';

//
// Included test cases:
//  - /// 1 /// - single theme
//  - /// 2 /// - with sub-theme
//

@include it('at-theme') {
	@include assert('single theme') { /// 1 ///
		@include output(false) {
			@include bem.block('something') {
				@include bem.at-theme('theme') {
					font-size: 2em;
				}
			}
		}

		@include expect(false) {
			.t-theme .something,
			[class*=' t-'] .t-theme .something,
			[class^='t-'] .t-theme .something {
				font-size: 2em;
			}
		}
	}

	@include assert('with sub-theme') { /// 2 ///
		@include output(false) {
			@include bem.block('something') {
				@include bem.at-theme('theme') {
					font-size: 2em;
				}

				@include bem.at-theme('theme', 'subtheme') {
					font-size: 3em;
				}
			}
		}

		@include expect(false) {
			.t-theme .something,
			[class*=' t-'] .t-theme .something,
			[class^='t-'] .t-theme .something {
				font-size: 2em;
			}

			.t-theme .t-subtheme .something,
			[class*=' t-'] .t-theme .t-subtheme .something,
			[class^='t-'] .t-theme .t-subtheme .something {
				font-size: 3em;
			}
		}
	}
}