Skip to content

Commit 01d3a6d

Browse files
authored
Fix rhythm heading cascade issue (#1866)
1 parent eb4c5ca commit 01d3a6d

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

.changeset/cuddly-dryers-build.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 headings in Rhythm objects not respecting cascade of `--rhythm` custom property

src/mixins/_spacing.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $fluid-spacing-inline-negative: fluid.fluid-clamp(
7171
> * + h5,
7272
> * + h6,
7373
> * + [class*='heading'] {
74-
margin-block-start: var(--rhythm-headings);
74+
margin-block-start: var(--rhythm-headings, var(--rhythm));
7575
}
7676
}
7777
}

src/objects/rhythm/demo/sections.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
} only %}
88
{% block content %}
99
{% for i in 1..3 %}
10+
{% if i == 2 %}
11+
<h2>More Sections Below</h2>
12+
{% endif %}
1013
<div>
1114
<h3>Section {{i}}</h3>
1215
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum quam tellus, auctor non faucibus consequat, dictum et dui. Praesent vitae magna sit amet odio egestas semper. Duis nec tellus ligula. Pellentesque mollis varius pulvinar. Suspendisse eu ultrices quam. In dignissim felis efficitur lorem porttitor porttitor. Aliquam maximus tempus erat ut sagittis.</p>

src/objects/rhythm/rhythm.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
:root {
55
--rhythm: #{size.$rhythm-default};
6-
--rhythm-headings: var(--rhythm);
76
}
87

98
.o-rhythm {

0 commit comments

Comments
 (0)