diff options
| author | Volpeon <git@volpeon.ink> | 2022-02-05 07:52:13 +0100 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2022-02-05 07:52:13 +0100 |
| commit | dd5f3c463fab336d694f426dcad11a1783590fc9 (patch) | |
| tree | faebf738a9556eaa393371852ed86550d4adf66a /test/bem/_composed-of.scss | |
| parent | Fix errors from transition from node-sass to sass (diff) | |
| download | iro-sass-dd5f3c463fab336d694f426dcad11a1783590fc9.tar.gz iro-sass-dd5f3c463fab336d694f426dcad11a1783590fc9.tar.bz2 iro-sass-dd5f3c463fab336d694f426dcad11a1783590fc9.zip | |
Ported from import syntax to modules
Diffstat (limited to 'test/bem/_composed-of.scss')
| -rw-r--r-- | test/bem/_composed-of.scss | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/test/bem/_composed-of.scss b/test/bem/_composed-of.scss new file mode 100644 index 0000000..fcbf2c4 --- /dev/null +++ b/test/bem/_composed-of.scss | |||
| @@ -0,0 +1,152 @@ | |||
| 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 /// - without namespace, single | ||
| 9 | // - /// 2 /// - with namespace, single | ||
| 10 | // - /// 3 /// - without namespace, multiple | ||
| 11 | // - /// 4 /// - with namespace, multiple | ||
| 12 | // | ||
| 13 | |||
| 14 | @include it('composed-of') { | ||
| 15 | @include assert('without namespace, single') { /// 1 /// | ||
| 16 | @include output(false) { | ||
| 17 | @include bem.block('something') { | ||
| 18 | font-size: 1em; | ||
| 19 | } | ||
| 20 | |||
| 21 | @include bem.block('another') { | ||
| 22 | @include bem.composed-of('something'); | ||
| 23 | |||
| 24 | font-size: 2em; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | @include expect(false) { | ||
| 29 | .something { | ||
| 30 | font-size: 1em; | ||
| 31 | } | ||
| 32 | |||
| 33 | .another { | ||
| 34 | font-size: 2em; | ||
| 35 | } | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
| 39 | @each $ns in map-keys(bem.$namespaces) { | ||
| 40 | @include assert('with namespace "#{$ns}", single') { /// 2 /// | ||
| 41 | @include output(false) { | ||
| 42 | @include bem.block('something', $ns) { | ||
| 43 | font-size: 1em; | ||
| 44 | } | ||
| 45 | |||
| 46 | @include bem.block('another') { | ||
| 47 | @include bem.composed-of('something' $ns); | ||
| 48 | |||
| 49 | font-size: 2em; | ||
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | @include expect(false) { | ||
| 54 | @if $ns != 'theme' { | ||
| 55 | .#{map-get(bem.$namespaces, $ns)}-something { | ||
| 56 | font-size: 1em; | ||
| 57 | } | ||
| 58 | } @else { | ||
| 59 | .t-something, | ||
| 60 | [class*=' t-'] .t-something, | ||
| 61 | [class^='t-'] .t-something { | ||
| 62 | font-size: 1em; | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | .another { | ||
| 67 | font-size: 2em; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | } | ||
| 71 | } | ||
| 72 | |||
| 73 | @include assert('without namespace, multiple') { /// 3 /// | ||
| 74 | @include output(false) { | ||
| 75 | @include bem.block('something') { | ||
| 76 | font-size: 1em; | ||
| 77 | } | ||
| 78 | |||
| 79 | @include bem.block('somethingElse') { | ||
| 80 | font-size: 1em; | ||
| 81 | } | ||
| 82 | |||
| 83 | @include bem.block('another') { | ||
| 84 | @include bem.composed-of('something', 'somethingElse'); | ||
| 85 | |||
| 86 | font-size: 2em; | ||
| 87 | } | ||
| 88 | } | ||
| 89 | |||
| 90 | @include expect(false) { | ||
| 91 | .something { | ||
| 92 | font-size: 1em; | ||
| 93 | } | ||
| 94 | |||
| 95 | .somethingElse { | ||
| 96 | font-size: 1em; | ||
| 97 | } | ||
| 98 | |||
| 99 | .another { | ||
| 100 | font-size: 2em; | ||
| 101 | } | ||
| 102 | } | ||
| 103 | } | ||
| 104 | |||
| 105 | @each $ns in map-keys(bem.$namespaces) { | ||
| 106 | @include assert('with namespace "#{$ns}", multiple') { /// 4 /// | ||
| 107 | @include output(false) { | ||
| 108 | @include bem.block('something', $ns) { | ||
| 109 | font-size: 1em; | ||
| 110 | } | ||
| 111 | |||
| 112 | @include bem.block('somethingElse', $ns) { | ||
| 113 | font-size: 1em; | ||
| 114 | } | ||
| 115 | |||
| 116 | @include bem.block('another') { | ||
| 117 | @include bem.composed-of('something' $ns, 'somethingElse' $ns); | ||
| 118 | |||
| 119 | font-size: 2em; | ||
| 120 | } | ||
| 121 | } | ||
| 122 | |||
| 123 | @include expect(false) { | ||
| 124 | @if $ns != 'theme' { | ||
| 125 | .#{map-get(bem.$namespaces, $ns)}-something { | ||
| 126 | font-size: 1em; | ||
| 127 | } | ||
| 128 | |||
| 129 | .#{map-get(bem.$namespaces, $ns)}-somethingElse { | ||
| 130 | font-size: 1em; | ||
| 131 | } | ||
| 132 | } @else { | ||
| 133 | .t-something, | ||
| 134 | [class*=' t-'] .t-something, | ||
| 135 | [class^='t-'] .t-something { | ||
| 136 | font-size: 1em; | ||
| 137 | } | ||
| 138 | |||
| 139 | .t-somethingElse, | ||
| 140 | [class*=' t-'] .t-somethingElse, | ||
| 141 | [class^='t-'] .t-somethingElse { | ||
| 142 | font-size: 1em; | ||
| 143 | } | ||
| 144 | } | ||
| 145 | |||
| 146 | .another { | ||
| 147 | font-size: 2em; | ||
| 148 | } | ||
| 149 | } | ||
| 150 | } | ||
| 151 | } | ||
| 152 | } | ||
