Skip to content

Commit f834259

Browse files
authored
Fix the responsive flex utilities (#465)
These were accidentally using the breakpoints as the upper bound instead of lower bound. This deprecates the old behavior and adds a global variable that can be set to enable the `min-width` based queries.
1 parent 9ef3e00 commit f834259

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

styles/utilities/_u-flex.scss

+16-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
========================================================================== */
1111

1212
$au-flex-utilities-responsive: false !default;
13+
$au-flex-utilities-reverse-responsive-breakpoints: false !default;
1314

1415
/* Utility classes
1516
========================================================================== */
@@ -130,7 +131,21 @@ $au-flex-utilities-responsive: false !default;
130131
@if ($au-flex-utilities-responsive == true) {
131132
@if (variable-exists(mq-breakpoints)) {
132133
@each $au-bp-name, $au-bp-value in $mq-breakpoints {
133-
@include mq($until: $au-bp-name) {
134+
$from: false;
135+
$until: $au-bp-name;
136+
137+
@if $au-flex-utilities-reverse-responsive-breakpoints {
138+
$from: $au-bp-name;
139+
$until: false;
140+
} @else {
141+
$warning-message: "\
142+
The current breakpoint behavior of the responsive `au-u-flex` utilities is deprecated. Instead of `max-width` they will use `min-width` queries to make them consistent with other responsive util classes.\
143+
Set the global `$au-flex-utilities-reverse-responsive-breakpoints` variable to `true` and modify the responsive classes where needed.";
144+
145+
@warn $warning-message;
146+
}
147+
148+
@include mq($from: $from, $until: $until) {
134149
.au-u-flex--wrap\@#{$au-bp-name} {
135150
flex-wrap: wrap !important;
136151
}

0 commit comments

Comments
 (0)