Skip to content

Commit 281163e

Browse files
committed
refactor(css): remove the deprecated flex bp classes
1 parent f558b07 commit 281163e

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

core/src/css/flex-utils.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,20 +129,22 @@ $flex-wrap-values: (
129129
wrap-reverse
130130
);
131131

132+
@each $value in $flex-wrap-values {
133+
// TODO(FW-6697): remove ion-wrap, ion-nowrap, ion-wrap-reverse
134+
// in favor of the new ion-flex-wrap, ion-flex-nowrap, and
135+
// ion-flex-wrap-reverse classes
136+
.ion-#{$value} {
137+
flex-wrap: #{$value} !important;
138+
}
139+
}
140+
132141
@each $breakpoint in map-keys($screen-breakpoints) {
133142
$infix: breakpoint-infix($breakpoint, $screen-breakpoints);
134143
@include media-breakpoint-up($breakpoint, $screen-breakpoints) {
135144
@each $value in $flex-wrap-values {
136145
.ion-flex#{$infix}-#{$value} {
137146
flex-wrap: #{$value} !important;
138147
}
139-
140-
// TODO(FW-6697): remove ion-wrap, ion-nowrap, ion-wrap-reverse
141-
// in favor of the new ion-flex-wrap, ion-flex-nowrap, and
142-
// ion-flex-wrap-reverse classes
143-
.ion#{$infix}-#{$value} {
144-
flex-wrap: #{$value} !important;
145-
}
146148
}
147149
}
148150
}

core/src/css/test/flex-utils.test.mjs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ for (const value of ALIGN_CONTENT_VALUES) {
2929
);
3030
}
3131

32-
// Responsive align content
3332
for (const bp of BREAKPOINTS) {
3433
for (const value of ALIGN_CONTENT_VALUES) {
3534
assert(
@@ -57,7 +56,6 @@ for (const value of ALIGN_ITEMS_VALUES) {
5756
);
5857
}
5958

60-
// Responsive align items
6159
for (const bp of BREAKPOINTS) {
6260
for (const value of ALIGN_ITEMS_VALUES) {
6361
assert(
@@ -86,7 +84,6 @@ for (const value of ALIGN_SELF_VALUES) {
8684
);
8785
}
8886

89-
// Responsive align self
9087
for (const bp of BREAKPOINTS) {
9188
for (const value of ALIGN_SELF_VALUES) {
9289
assert(
@@ -115,7 +112,6 @@ for (const value of JUSTIFY_CONTENT_VALUES) {
115112
);
116113
}
117114

118-
// Responsive justify content
119115
for (const bp of BREAKPOINTS) {
120116
for (const value of JUSTIFY_CONTENT_VALUES) {
121117
assert(
@@ -142,7 +138,6 @@ for (const value of FLEX_DIRECTION_VALUES) {
142138
);
143139
}
144140

145-
// Responsive flex direction
146141
for (const bp of BREAKPOINTS) {
147142
for (const value of FLEX_DIRECTION_VALUES) {
148143
assert(
@@ -174,15 +169,8 @@ for (const value of FLEX_WRAP_VALUES) {
174169
);
175170
}
176171

177-
// Responsive flex wrap
178172
for (const bp of BREAKPOINTS) {
179173
for (const value of FLEX_WRAP_VALUES) {
180-
// TODO(FW-6697): remove assert for .ion-${bp}-${value} classes
181-
assert(
182-
css.includes(`.ion-${bp}-${value}`),
183-
`CSS should include .ion-${bp}-${value} class`
184-
);
185-
186174
assert(
187175
css.includes(`.ion-flex-${bp}-${value}`),
188176
`CSS should include .ion-flex-${bp}-${value} class`
@@ -207,7 +195,6 @@ for (const value of FLEX_FILL_VALUES) {
207195
);
208196
}
209197

210-
// Responsive flex fill
211198
for (const bp of BREAKPOINTS) {
212199
for (const value of FLEX_FILL_VALUES) {
213200
assert(
@@ -237,7 +224,6 @@ for (const value of FLEX_GROW_SHRINK_VALUES) {
237224
);
238225
}
239226

240-
// Responsive flex grow and shrink
241227
for (const bp of BREAKPOINTS) {
242228
for (const value of FLEX_GROW_SHRINK_VALUES) {
243229
assert(
@@ -272,7 +258,6 @@ for (let i = 0; i <= 12; i++) {
272258
);
273259
}
274260

275-
// Responsive flex order
276261
for (const bp of BREAKPOINTS) {
277262
assert(
278263
css.includes(`.ion-order-${bp}-first`),

0 commit comments

Comments
 (0)