diff options
| author | Volpeon <git@volpeon.ink> | 2025-08-13 12:01:46 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2025-08-13 12:01:46 +0200 |
| commit | f0f84513f8efe533b6ee670a6f1a0c074387b2ec (patch) | |
| tree | 845bc4bacf1bd99acb0dfcc7e4545a36b544d2f8 /test/bem/_composed-of.scss | |
| parent | More fix (diff) | |
| download | iro-sass-f0f84513f8efe533b6ee670a6f1a0c074387b2ec.tar.gz iro-sass-f0f84513f8efe533b6ee670a6f1a0c074387b2ec.tar.bz2 iro-sass-f0f84513f8efe533b6ee670a6f1a0c074387b2ec.zip | |
Make use of SASS modules
Diffstat (limited to 'test/bem/_composed-of.scss')
| -rw-r--r-- | test/bem/_composed-of.scss | 237 |
1 files changed, 124 insertions, 113 deletions
diff --git a/test/bem/_composed-of.scss b/test/bem/_composed-of.scss index fcbf2c4..6a5f4ba 100644 --- a/test/bem/_composed-of.scss +++ b/test/bem/_composed-of.scss | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | // sass-lint:disable class-name-format force-element-nesting force-pseudo-nesting mixins-before-declarations | 1 | // sass-lint:disable class-name-format force-element-nesting force-pseudo-nesting mixins-before-declarations |
| 2 | 2 | ||
| 3 | @use 'sass:map'; | ||
| 3 | @use 'true' as *; | 4 | @use 'true' as *; |
| 4 | @use '../../src/bem'; | 5 | @use '../../src/bem'; |
| 5 | 6 | ||
| @@ -12,141 +13,151 @@ | |||
| 12 | // | 13 | // |
| 13 | 14 | ||
| 14 | @include it('composed-of') { | 15 | @include it('composed-of') { |
| 15 | @include assert('without namespace, single') { /// 1 /// | 16 | @include assert('without namespace, single') { /// 1 /// |
| 16 | @include output(false) { | 17 | @include output(false) { |
| 17 | @include bem.block('something') { | 18 | @include bem.block('something') { |
| 18 | font-size: 1em; | 19 | font-size: 1em; |
| 19 | } | 20 | } |
| 20 | 21 | ||
| 21 | @include bem.block('another') { | 22 | @include bem.block('another') { |
| 22 | @include bem.composed-of('something'); | 23 | @include bem.composed-of('something'); |
| 23 | 24 | ||
| 24 | font-size: 2em; | 25 | font-size: 2em; |
| 25 | } | 26 | } |
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | @include expect(false) { | 29 | @include expect(false) { |
| 29 | .something { | 30 | .something { |
| 30 | font-size: 1em; | 31 | font-size: 1em; |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | .another { | 34 | .another { |
| 34 | font-size: 2em; | 35 | font-size: 2em; |
| 35 | } | 36 | } |
| 36 | } | 37 | } |
| 37 | } | 38 | } |
| 38 | 39 | ||
| 39 | @each $ns in map-keys(bem.$namespaces) { | 40 | @each $ns in map.keys(bem.$namespaces) { |
| 40 | @include assert('with namespace "#{$ns}", single') { /// 2 /// | 41 | @include assert('with namespace "#{$ns}", single') { /// 2 /// |
| 41 | @include output(false) { | 42 | @include output(false) { |
| 42 | @include bem.block('something', $ns) { | 43 | @include bem.block('something', $ns) { |
| 43 | font-size: 1em; | 44 | font-size: 1em; |
| 44 | } | 45 | } |
| 45 | 46 | ||
| 46 | @include bem.block('another') { | 47 | @include bem.block('another') { |
| 47 | @include bem.composed-of('something' $ns); | 48 | @include bem.composed-of('something' $ns); |
| 48 | 49 | ||
| 49 | font-size: 2em; | 50 | font-size: 2em; |
| 50 | } | 51 | } |
| 51 | } | 52 | } |
| 52 | 53 | ||
| 53 | @include expect(false) { | 54 | @include expect(false) { |
| 54 | @if $ns != 'theme' { | 55 | @layer #{$ns} { |
| 55 | .#{map-get(bem.$namespaces, $ns)}-something { | 56 | @if $ns != 'theme' { |
| 56 | font-size: 1em; | 57 | .#{map.get(bem.$namespaces, $ns)}-something { |
| 57 | } | 58 | font-size: 1em; |
| 58 | } @else { | 59 | } |
| 59 | .t-something, | 60 | } @else { |
| 60 | [class*=' t-'] .t-something, | 61 | .t-something, |
| 61 | [class^='t-'] .t-something { | 62 | [class*=' t-'] .t-something, |
| 62 | font-size: 1em; | 63 | [class^='t-'] .t-something { |
| 63 | } | 64 | font-size: 1em; |
| 64 | } | 65 | } |
| 66 | } | ||
| 67 | } | ||
| 65 | 68 | ||
| 66 | .another { | 69 | .another { |
| 67 | font-size: 2em; | 70 | font-size: 2em; |
| 68 | } | 71 | } |
| 69 | } | 72 | } |
| 70 | } | 73 | } |
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | @include assert('without namespace, multiple') { /// 3 /// | 76 | @include assert('without namespace, multiple') { /// 3 /// |
| 74 | @include output(false) { | 77 | @include output(false) { |
| 75 | @include bem.block('something') { | 78 | @include bem.block('something') { |
| 76 | font-size: 1em; | 79 | font-size: 1em; |
| 77 | } | 80 | } |
| 78 | 81 | ||
| 79 | @include bem.block('somethingElse') { | 82 | @include bem.block('somethingElse') { |
| 80 | font-size: 1em; | 83 | font-size: 1em; |
| 81 | } | 84 | } |
| 82 | 85 | ||
| 83 | @include bem.block('another') { | 86 | @include bem.block('another') { |
| 84 | @include bem.composed-of('something', 'somethingElse'); | 87 | @include bem.composed-of('something', 'somethingElse'); |
| 85 | 88 | ||
| 86 | font-size: 2em; | 89 | font-size: 2em; |
| 87 | } | 90 | } |
| 88 | } | 91 | } |
| 89 | 92 | ||
| 90 | @include expect(false) { | 93 | @include expect(false) { |
| 91 | .something { | 94 | .something { |
| 92 | font-size: 1em; | 95 | font-size: 1em; |
| 93 | } | 96 | } |
| 94 | 97 | ||
| 95 | .somethingElse { | 98 | .somethingElse { |
| 96 | font-size: 1em; | 99 | font-size: 1em; |
| 97 | } | 100 | } |
| 98 | 101 | ||
| 99 | .another { | 102 | .another { |
| 100 | font-size: 2em; | 103 | font-size: 2em; |
| 101 | } | 104 | } |
| 102 | } | 105 | } |
| 103 | } | 106 | } |
| 104 | 107 | ||
| 105 | @each $ns in map-keys(bem.$namespaces) { | 108 | @each $ns in map.keys(bem.$namespaces) { |
| 106 | @include assert('with namespace "#{$ns}", multiple') { /// 4 /// | 109 | @include assert('with namespace "#{$ns}", multiple') { /// 4 /// |
| 107 | @include output(false) { | 110 | @include output(false) { |
| 108 | @include bem.block('something', $ns) { | 111 | @include bem.block('something', $ns) { |
| 109 | font-size: 1em; | 112 | font-size: 1em; |
| 110 | } | 113 | } |
| 111 | 114 | ||
| 112 | @include bem.block('somethingElse', $ns) { | 115 | @include bem.block('somethingElse', $ns) { |
| 113 | font-size: 1em; | 116 | font-size: 1em; |
| 114 | } | 117 | } |
| 115 | 118 | ||
| 116 | @include bem.block('another') { | 119 | @include bem.block('another') { |
| 117 | @include bem.composed-of('something' $ns, 'somethingElse' $ns); | 120 | @include bem.composed-of('something' $ns, 'somethingElse' $ns); |
| 118 | 121 | ||
| 119 | font-size: 2em; | 122 | font-size: 2em; |
| 120 | } | 123 | } |
| 121 | } | 124 | } |
| 122 | 125 | ||
| 123 | @include expect(false) { | 126 | @include expect(false) { |
| 124 | @if $ns != 'theme' { | 127 | @if $ns != 'theme' { |
| 125 | .#{map-get(bem.$namespaces, $ns)}-something { | 128 | @layer #{$ns} { |
| 126 | font-size: 1em; | 129 | .#{map.get(bem.$namespaces, $ns)}-something { |
| 127 | } | 130 | font-size: 1em; |
| 131 | } | ||
| 132 | } | ||
| 128 | 133 | ||
| 129 | .#{map-get(bem.$namespaces, $ns)}-somethingElse { | 134 | @layer #{$ns} { |
| 130 | font-size: 1em; | 135 | .#{map.get(bem.$namespaces, $ns)}-somethingElse { |
| 131 | } | 136 | font-size: 1em; |
| 132 | } @else { | 137 | } |
| 133 | .t-something, | 138 | } |
| 134 | [class*=' t-'] .t-something, | 139 | } @else { |
| 135 | [class^='t-'] .t-something { | 140 | @layer #{$ns} { |
| 136 | font-size: 1em; | 141 | .t-something, |
| 137 | } | 142 | [class*=' t-'] .t-something, |
| 143 | [class^='t-'] .t-something { | ||
| 144 | font-size: 1em; | ||
| 145 | } | ||
| 146 | } | ||
| 138 | 147 | ||
| 139 | .t-somethingElse, | 148 | @layer #{$ns} { |
| 140 | [class*=' t-'] .t-somethingElse, | 149 | .t-somethingElse, |
| 141 | [class^='t-'] .t-somethingElse { | 150 | [class*=' t-'] .t-somethingElse, |
| 142 | font-size: 1em; | 151 | [class^='t-'] .t-somethingElse { |
| 143 | } | 152 | font-size: 1em; |
| 144 | } | 153 | } |
| 154 | } | ||
| 155 | } | ||
| 145 | 156 | ||
| 146 | .another { | 157 | .another { |
| 147 | font-size: 2em; | 158 | font-size: 2em; |
| 148 | } | 159 | } |
| 149 | } | 160 | } |
| 150 | } | 161 | } |
| 151 | } | 162 | } |
| 152 | } | 163 | } |
