Skip to content

Commit af0d577

Browse files
authored
Update Hype Group breakpoint (#2173)
1 parent acfd594 commit af0d577

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

.changeset/flat-bulldogs-worry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': patch
3+
---
4+
5+
Slight change to Hype Group breakpoints to better support the intended amount of content

src/objects/hype-group/demo/single.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
{% if example_paragraphs > 2 %}
1919
<p>Nunc pellentesque eu purus vel aliquet. Vestibulum sed nulla tellus. Sed sed ante varius, facilisis dui in, lacinia dui. Sed convallis aliquam dolor, sit amet pretium nibh dignissim quis.</p>
2020
{% endif %}
21+
{% if example_paragraphs > 3 %}
22+
<p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Mauris turpis justo, condimentum pharetra urna aliquet, vehicula mattis neque.</p>
23+
{% endif %}
2124
{% if example_paragraphs > 1 %}
2225
{% include '@cloudfour/components/media-link/media-link.twig' with {
2326
"href": "https://cloudfour.com/thinks/performance-is-an-issue-of-equity/",

src/objects/hype-group/hype-group.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
@use '../../mixins/theme';
66
@use 'sass:color' as sasscolor;
77

8+
/// There's one breakpoint that's just a bit off from what we need for the
9+
/// typical amount of content we have.
10+
$breakpoint-wide: breakpoint.$m + 5em;
11+
812
/// Vary image outline colors based on theme. This is the only real style that
913
/// IMO stretches the definition of "object" a bit, but it's a nice way to
1014
/// support different sorts of image content.
@@ -35,7 +39,7 @@
3539
/// Above a certain breakpoint, we switch to using Grid for layout. We can't
3640
/// do this from the beginning since the smallest layouts use floats.
3741

38-
@media (width >= breakpoint.$m) {
42+
@media (width >= $breakpoint-wide) {
3943
column-gap: spacing.$fluid-gap;
4044
display: grid;
4145
grid-template-areas:
@@ -63,7 +67,7 @@
6367
/// the object left at smaller viewports would greatly disrupt the reading line.
6468

6569
.o-hype-group--reverse {
66-
@media (width >= breakpoint.$m) {
70+
@media (width >= $breakpoint-wide) {
6771
grid-template-areas:
6872
'object .'
6973
'object intro'
@@ -110,7 +114,7 @@
110114
/// 2. We subtract a bit of gap space so the visual object does not appear to
111115
/// be taking up _more_ space than the content (they should appear equal).
112116

113-
@media (width < breakpoint.$m) {
117+
@media (width < $breakpoint-wide) {
114118
aspect-ratio: 2/3; // 1
115119
float: right;
116120
inline-size: calc(50% - #{size.$spacing-gap-inline-small}); // 2
@@ -182,7 +186,7 @@
182186
/// over the wrong edges depending on the `--reverse` modifier and the
183187
/// length of adjacent content.
184188

185-
@media (width >= breakpoint.$m) {
189+
@media (width >= $breakpoint-wide) {
186190
block-size: 100cqmax; // 1
187191
inset-block-start: 50%; // 2
188192
position: absolute; // 2

src/objects/hype-group/hype-group.stories.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import { Canvas, Meta, Story } from '@storybook/addon-docs';
22
import singleDemo from './demo/single.twig';
33
import multipleDemo from './demo/multiple.twig';
4+
const defaultArgs = {
5+
content_class: 'o-rhythm',
6+
object_shape: 'circle',
7+
example_paragraphs: 3,
8+
example_object_img_src: '/media/feature-ozzie-wide.jpg',
9+
example_object_img_size: 480,
10+
};
411
const demoStory = (args, multiple) => {
12+
args = { ...defaultArgs, ...args };
513
if (args.object_shape === 'square') {
614
delete args.object_shape;
715
}
@@ -33,13 +41,6 @@ const singleTransformSource = (_src, storyContext) => {
3341
{% endblock %}
3442
{% endembed %}`;
3543
};
36-
const defaultArgs = {
37-
content_class: 'o-rhythm',
38-
object_shape: 'circle',
39-
example_paragraphs: 2,
40-
example_object_img_src: '/media/feature-ozzie-wide.jpg',
41-
example_object_img_size: 480,
42-
};
4344

4445
<Meta
4546
title="Objects/Hype Group"
@@ -61,7 +62,7 @@ const defaultArgs = {
6162
control: {
6263
type: 'range',
6364
min: 1,
64-
max: 3,
65+
max: 4,
6566
step: 1,
6667
},
6768
},

0 commit comments

Comments
 (0)