|
27 | 27 |
|
28 | 28 | /* Row: justify-content */
|
29 | 29 | @each $justify-content-variant in (flex-start, center, flex-end, space-between, space-around, space-evenly) {
|
30 |
| - .row-justify-content-$(justify-content-variant) { |
31 |
| - justify-content: $justify-content-variant; |
32 |
| - } |
33 |
| - |
34 | 30 | @each $breakpoint in (xxs, xs, sm, md, lg, xl, xxl) {
|
35 |
| - .row-justify-content-$(breakpoint)-$(justify-content-variant) { |
36 |
| - justify-content: $justify-content-variant; |
| 31 | + @media (--gte-$breakpoint) { |
| 32 | + .row-justify-content-$(breakpoint)-$(justify-content-variant) { |
| 33 | + justify-content: $justify-content-variant; |
| 34 | + } |
37 | 35 | }
|
38 | 36 | }
|
39 | 37 | }
|
40 | 38 |
|
41 | 39 | /* Row: align-items */
|
42 | 40 | @each $align-items-variant in (flex-start, center, flex-end, baseline, stretch) {
|
43 |
| - .row-align-items-$(align-items-variant) { |
44 |
| - align-items: $align-items-variant; |
45 |
| - } |
46 |
| - |
47 | 41 | @each $breakpoint in (xxs, xs, sm, md, lg, xl, xxl) {
|
48 |
| - .row-align-items-$(breakpoint)-$(align-items-variant) { |
49 |
| - align-items: $align-items-variant; |
| 42 | + @media (--gte-$breakpoint) { |
| 43 | + .row-align-items-$(breakpoint)-$(align-items-variant) { |
| 44 | + align-items: $align-items-variant; |
| 45 | + } |
50 | 46 | }
|
51 | 47 | }
|
52 | 48 | }
|
53 | 49 |
|
54 |
| -/* Col: auto */ |
55 |
| -.col-column-auto { |
56 |
| - width: auto; |
57 |
| - flex: 0 0 auto; |
58 |
| -} |
59 |
| - |
| 50 | +/* col: [xxs, xxl] */ |
60 | 51 | @each $breakpoint in (xxs, xs, sm, md, lg, xl, xxl) {
|
| 52 | + $columns: 12; |
| 53 | + $offsets: 11; |
| 54 | + |
61 | 55 | @media (--gte-$breakpoint) {
|
| 56 | + /* columns = auto */ |
62 | 57 | .col-column-$(breakpoint)-auto {
|
63 | 58 | width: auto;
|
| 59 | + max-width: none; |
64 | 60 | flex: 0 0 auto;
|
65 | 61 | }
|
66 |
| - } |
67 |
| -} |
68 | 62 |
|
69 |
| -/* Col: [xxs, xs] */ |
70 |
| -@each $breakpoint in (xxs, xs) { |
71 |
| - $columns: 4; |
72 |
| - $offsets: 3; |
73 |
| - |
74 |
| - /* columns = <number> */ |
75 |
| - @for $x from 1 to $columns by 1 { |
76 |
| - @media (--gte-$breakpoint) { |
77 |
| - .col-column-$(x) { |
78 |
| - max-width: calc($x / $columns * 100%); |
79 |
| - flex: 0 0 calc($x / $columns * 100%); |
80 |
| - } |
| 63 | + /* columns = <number> */ |
| 64 | + @for $x from 1 to $columns by 1 { |
81 | 65 | .col-column-$(breakpoint)-$(x) {
|
| 66 | + width: calc($x / $columns * 100%); |
82 | 67 | max-width: calc($x / $columns * 100%);
|
83 | 68 | flex: 0 0 calc($x / $columns * 100%);
|
84 | 69 | }
|
85 | 70 | }
|
86 |
| - } |
87 | 71 |
|
88 |
| - /* offset = <number> */ |
89 |
| - @for $x from 0 to $offsets by 1 { |
90 |
| - @media (--gte-$breakpoint) { |
91 |
| - .col-offset-$(x) { |
92 |
| - margin-left: calc($x / $columns * 100%); |
93 |
| - } |
94 |
| - .col-offset-$(breakpoint)-$(x) { |
95 |
| - margin-left: calc($x / $columns * 100%); |
| 72 | + /* offset = <number> */ |
| 73 | + @for $x from 0 to $offsets by 1 { |
| 74 | + @media (--gte-$breakpoint) { |
| 75 | + .col-offset-$(breakpoint)-$(x) { |
| 76 | + margin-left: calc($x / $columns * 100%); |
| 77 | + } |
96 | 78 | }
|
97 | 79 | }
|
98 | 80 | }
|
99 | 81 | }
|
100 | 82 |
|
101 |
| -/* col: [sm, sm] */ |
102 |
| -@each $breakpoint in (sm) { |
| 83 | +/* Col: [xxs, sm] (overrides) */ |
| 84 | +@each $breakpoint in (xxs, xs, sm) { |
103 | 85 | $columns: 8;
|
104 | 86 | $offsets: 7;
|
105 | 87 |
|
106 |
| - /* columns = <number> */ |
107 |
| - @for $x from 1 to $columns by 1 { |
108 |
| - @media (--gte-$breakpoint) { |
109 |
| - .col-column-$(x) { |
110 |
| - max-width: calc($x / $columns * 100%); |
111 |
| - flex: 0 0 calc($x / $columns * 100%); |
112 |
| - } |
113 |
| - .col-column-$(breakpoint)-$(x) { |
114 |
| - max-width: calc($x / $columns * 100%); |
115 |
| - flex: 0 0 calc($x / $columns * 100%); |
116 |
| - } |
117 |
| - } |
118 |
| - } |
119 |
| - |
120 |
| - /* offset = <number> */ |
121 |
| - @for $x from 0 to $offsets by 1 { |
122 |
| - @media (--gte-$breakpoint) { |
123 |
| - .col-offset-$(x) { |
124 |
| - margin-left: calc($x / $columns * 100%); |
125 |
| - } |
126 |
| - .col-offset-$(breakpoint)-$(x) { |
127 |
| - margin-left: calc($x / $columns * 100%); |
128 |
| - } |
| 88 | + @media (--gte-$breakpoint) and (--lt-md) { |
| 89 | + /* columns = auto */ |
| 90 | + .col-column-$(breakpoint)-auto { |
| 91 | + width: auto; |
| 92 | + max-width: none; |
| 93 | + flex: 0 0 auto; |
129 | 94 | }
|
130 |
| - } |
131 |
| -} |
132 | 95 |
|
133 |
| -/* col: [md, xxl] */ |
134 |
| -@each $breakpoint in (md, lg, xl, xxl) { |
135 |
| - $columns: 12; |
136 |
| - $offsets: 11; |
137 |
| - |
138 |
| - /* columns = <number> */ |
139 |
| - @for $x from 1 to $columns by 1 { |
140 |
| - @media (--gte-$breakpoint) { |
141 |
| - .col-column-$(x) { |
142 |
| - max-width: calc($x / $columns * 100%); |
143 |
| - flex: 0 0 calc($x / $columns * 100%); |
144 |
| - } |
| 96 | + /* columns = <number> */ |
| 97 | + @for $x from 1 to $columns by 1 { |
145 | 98 | .col-column-$(breakpoint)-$(x) {
|
| 99 | + width: calc($x / $columns * 100%); |
146 | 100 | max-width: calc($x / $columns * 100%);
|
147 | 101 | flex: 0 0 calc($x / $columns * 100%);
|
148 | 102 | }
|
149 | 103 | }
|
150 |
| - } |
151 | 104 |
|
152 |
| - /* offset = <number> */ |
153 |
| - @for $x from 0 to $offsets by 1 { |
154 |
| - @media (--gte-$breakpoint) { |
155 |
| - .col-offset-$(x) { |
156 |
| - margin-left: calc($x / $columns * 100%); |
157 |
| - } |
| 105 | + /* offset = <number> */ |
| 106 | + @for $x from 0 to $offsets by 1 { |
158 | 107 | .col-offset-$(breakpoint)-$(x) {
|
159 | 108 | margin-left: calc($x / $columns * 100%);
|
160 | 109 | }
|
|
0 commit comments