Skip to content

Commit a2a7543

Browse files
Fix Bio object design inconsistencies (#1747)
1 parent ab373f8 commit a2a7543

File tree

6 files changed

+41
-12
lines changed

6 files changed

+41
-12
lines changed

.changeset/funny-actors-approve.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+
Fix Bio object design inconsistencies per prototype designs

src/mixins/_fluid.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
/// Generate a fluid `clamp` function. Unlike `fluid-calc`, this will prevent
4444
/// the value from going below `$min` or above `$max`.
4545
///
46+
/// The fluid-clamp is a more predictable clamp over the native CSS clamp. It will
47+
/// return predictable values between the $min and $max values between the
48+
/// $min-width and $max-width breakpoints. In other words, you get a size relative
49+
/// to the viewport width but between the $min and $max values. Very neat!
50+
///
4651
/// @param {Number} $min - The minimum amount.
4752
/// @param {Number} $max - The maximum amount.
4853
/// @param {Number} $min-width [breakpoint.$s] - The minimum viewport width in ems.

src/objects/bio/bio.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
@use '../../compiled/tokens/scss/breakpoint';
22
@use '../../compiled/tokens/scss/size';
33
@use '../../mixins/fluid';
4+
@use '../../mixins/ms';
45

56
.o-bio {
67
display: grid;
7-
grid-gap: fluid.fluid-clamp(
8+
gap: fluid.fluid-clamp(
89
size.$spacing-gap-fluid-min,
910
size.$spacing-gap-fluid-max,
1011
breakpoint.$s,
@@ -14,18 +15,25 @@
1415
'avatar'
1516
'content'
1617
'meta';
17-
grid-template-rows: repeat(3, minmax(0, auto));
1818

1919
@media (min-width: breakpoint.$l) {
2020
grid-template-areas:
2121
'avatar content content'
2222
'meta content content';
2323
grid-template-columns: repeat(3, 1fr);
24+
row-gap: ms.step(0);
2425
}
2526
}
2627

2728
.o-bio__avatar {
2829
grid-area: avatar;
30+
inline-size: 100%;
31+
margin: 0 auto;
32+
max-inline-size: size.$square-avatar-large;
33+
@media (min-width: breakpoint.$l) {
34+
font-size: ms.step(1);
35+
inline-size: 100%;
36+
}
2937
}
3038

3139
.o-bio__content {
@@ -34,4 +42,7 @@
3442

3543
.o-bio__meta {
3644
grid-area: meta;
45+
@media (min-width: breakpoint.$l) {
46+
text-align: center;
47+
}
3748
}

src/objects/bio/bio.twig

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{% set _meta %}{% block meta %}{% endblock %}{% endset %}
2+
{% set _bio_content %}{% block content %}{% endblock %}{% endset %}
23

34
<div class="o-bio">
4-
<div class="o-bio__content">
5-
{% block content %}{% endblock %}
6-
</div>
5+
{% embed '@cloudfour/objects/container/container.twig' with {
6+
class: 'o-bio__content o-container--prose'
7+
} %}
8+
{% block content %}
9+
{{_bio_content}}
10+
{% endblock %}
11+
{% endembed %}
712
<div class="o-bio__avatar">
813
{% block avatar %}{% endblock %}
914
</div>

src/objects/bio/demo/demo.twig

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,23 @@
1111
<header>
1212
{% include '@cloudfour/components/heading/heading.twig' with {
1313
content: 'Danielle Romo',
14+
subheading: 'Front-end Designer',
1415
level: 1
1516
} only %}
16-
<p>Front-end Designer</p>
1717
</header>
1818
<p>Danielle is a front-end designer passionate about all things creative including design, art, and music. She began her career as a graphic designer and draws on her visual design skills to create engaging experiences for the web. She hasn't stopped learning since taking her first web design class and continues to develop her coding skills one web page at a time.</p>
1919
<p>Outside of work, you can find her drawing, listening to true crime podcasts, or hiking the beautiful Pacific Northwest.</p>
2020
{% endblock %}
2121
{% endembed %}
2222
{% endblock %}
2323
{% block meta %}
24-
<ul>
25-
<li><a href="#">Website link</a></li>
26-
<li><a href="#">Website link</a></li>
27-
<li><a href="#">Social media link</a></li>
28-
<li><a href="#">Social media link</a></li>
29-
</ul>
24+
{% embed '@cloudfour/objects/list/list.twig' %}
25+
{% block content %}
26+
<li><a href="#">Website link</a></li>
27+
<li><a href="#">Website link</a></li>
28+
<li><a href="#">Social media link</a></li>
29+
<li><a href="#">Social media link</a></li>
30+
{% endblock %}
31+
{% endembed %}
3032
{% endblock %}
3133
{% endembed %}

src/tokens/size/sizing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module.exports = {
4040
avatar: {
4141
small: { value: modularEm(3) },
4242
medium: { value: modularEm(5) },
43+
large: { value: modularEm(11) },
4344
full: { value: '100%' },
4445
},
4546
control: {

0 commit comments

Comments
 (0)