|
2 | 2 | @import 'mixins/placeholder-selectors';
|
3 | 3 |
|
4 | 4 | .partners .results {
|
5 |
| - padding: 2rem $normal-margin 20rem; |
| 5 | + padding: 2rem 0 20rem; |
6 | 6 |
|
7 | 7 | @include width-up-to($phone-max) {
|
8 | 8 | padding: 0 $normal-margin 6rem;
|
|
24 | 24 |
|
25 | 25 | h2 {
|
26 | 26 | margin: 0;
|
| 27 | + width: 100%; |
| 28 | + text-align: center; |
| 29 | + background-color: ui-color(form-border); |
| 30 | + padding: $normal-margin 0; |
| 31 | + border: thin solid ui-color(black); |
27 | 32 | }
|
28 | 33 |
|
| 34 | + /* |
| 35 | + We want to make breakpoints for each possible number of cards |
| 36 | + on a row, from 2 to 5, such that the row with a sidebar has one |
| 37 | + fewer cards per row. |
| 38 | + first: 2 cards on top, 1 on bottom |
| 39 | + second: 3/2 |
| 40 | + third: 4/3 |
| 41 | + above: 5/4 |
| 42 | + These values are found experimentally using the grid-template-columns |
| 43 | + on .grid above. If that changes, they need to be refigured. |
| 44 | + There is some chance that different browsers will differ. |
| 45 | + */ |
| 46 | + $first-break: 68.9em * $scale-factor; |
| 47 | + $second-break: 91.9em * $scale-factor; |
| 48 | + $third-break: 114.9em * $scale-factor; |
| 49 | + |
29 | 50 | @mixin partner-grid {
|
30 | 51 | display: grid;
|
31 |
| - grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); |
32 | 52 | grid-auto-rows: minmax(min-content, 100%);
|
33 | 53 | padding: 0;
|
34 | 54 |
|
| 55 | + @include width-between($phone-max, $first-break) { |
| 56 | + grid-template-columns: repeat(2, 1fr); |
| 57 | + } |
| 58 | + @include width-between($first-break, $second-break) { |
| 59 | + grid-template-columns: repeat(3, 1fr); |
| 60 | + } |
| 61 | + @include width-between($second-break, $third-break) { |
| 62 | + grid-template-columns: repeat(4, 1fr); |
| 63 | + } |
| 64 | + @include wider-than($third-break) { |
| 65 | + grid-template-columns: repeat(5, 1fr); |
| 66 | + } |
| 67 | + |
35 | 68 | @include width-up-to($phone-max) {
|
36 | 69 | grid-gap: 1.5rem;
|
37 | 70 | justify-content: center;
|
|
123 | 156 |
|
124 | 157 | .boxed {
|
125 | 158 | gap: 3rem;
|
| 159 | + padding: 0; |
126 | 160 |
|
127 | 161 | @include width-up-to($phone-max) {
|
128 | 162 | gap: $normal-margin;
|
129 |
| - padding: 0; |
130 | 163 | }
|
131 | 164 | }
|
132 | 165 |
|
133 | 166 | .with-sidebar {
|
134 |
| - h2 { |
135 |
| - text-align: center; |
136 |
| - } |
| 167 | + .grid { |
| 168 | + @include width-between($phone-max, $first-break) { |
| 169 | + grid-template-columns: repeat(1, 1fr); |
| 170 | + } |
| 171 | + @include width-between($first-break, $second-break) { |
| 172 | + grid-template-columns: repeat(2, 1fr); |
| 173 | + } |
| 174 | + @include width-between($second-break, $third-break) { |
| 175 | + grid-template-columns: repeat(3, 1fr); |
| 176 | + } |
| 177 | + @include wider-than($third-break) { |
| 178 | + grid-template-columns: repeat(4, 1fr); |
| 179 | + } |
| 180 | + } |
137 | 181 |
|
138 | 182 | @include width-up-to($phone-max) {
|
139 | 183 | > .boxed {
|
|
159 | 203 | @include wider-than($phone-max) {
|
160 | 204 | display: flex;
|
161 | 205 | flex-direction: row;
|
162 |
| - gap: $normal-margin; |
| 206 | + gap: 3rem; |
163 | 207 | max-width: 120rem;
|
164 |
| - margin: 0 auto; |
165 |
| - padding-right: $normal-margin; |
| 208 | + margin: 0 auto 3rem; |
166 | 209 |
|
167 | 210 | .grid {
|
168 | 211 | max-width: unset;
|
169 | 212 | }
|
170 | 213 |
|
171 | 214 | > .sidebar {
|
172 |
| - border: thin solid black; |
| 215 | + outline: thin solid black; |
173 | 216 | height: max-content;
|
174 |
| - |
| 217 | + |
175 | 218 | .sidebar-content {
|
176 | 219 | background-color: ui-color(white);
|
177 | 220 |
|
|
186 | 229 | }
|
187 | 230 |
|
188 | 231 | h2 {
|
189 |
| - @include set-font(h3); |
190 |
| - |
191 |
| - background-color: os-color(gray); |
192 |
| - color: ui-color(white); |
193 |
| - padding: $normal-margin; |
| 232 | + border: 0; |
194 | 233 | }
|
195 | 234 |
|
196 | 235 | .grid {
|
|
205 | 244 | }
|
206 | 245 | }
|
207 | 246 | }
|
208 |
| - @include width-between($phone-max, $tablet-max) { |
209 |
| - > .sidebar { |
210 |
| - min-width: calc(50% - 3rem); |
| 247 | + > .sidebar { |
| 248 | + @include width-between($phone-max, $first-break) { |
| 249 | + min-width: calc(50% - 1.5rem); |
| 250 | + max-width: calc(50% - 1.5rem); |
211 | 251 | }
|
212 |
| - } |
213 |
| - @include wider-than($tablet-max) { |
214 |
| - > .sidebar { |
215 |
| - min-width: calc(25% + 12rem); |
| 252 | + @include width-between($first-break, $second-break) { |
| 253 | + min-width: calc(33.3% - 3rem); |
| 254 | + max-width: calc(33.3% - 3rem); |
| 255 | + } |
| 256 | + @include wider-than($second-break) { |
| 257 | + min-width: calc(25% - 4.5rem); |
| 258 | + max-width: calc(25% + 1.5rem); |
216 | 259 | }
|
217 | 260 | }
|
218 | 261 | }
|
|
0 commit comments