Skip to content

Commit f14ccb0

Browse files
authored
Make nested headings inherit font colors (#1506)
This is necessary in Wordpress to be able to apply Gutenberg colors classes to permalinked headings
1 parent 30641c9 commit f14ccb0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.changeset/sharp-moles-lick.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+
Make nested headings inherit font colors

src/components/heading/heading.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ $max-width-permalink-shift: math.div($min-width-permalink-shift * 16 - 1, 16);
113113

114114
/// For complex headings (those containing a permalink and/or subheading), the
115115
/// actual `h*` element must be a child element, so we inherit the container's
116-
/// font styles. It's important the containing element retain the heading font
117-
/// styles for vertical rhythm to work as intended!
116+
/// font and color styles. It's important the containing element retain the
117+
/// heading font styles for vertical rhythm to work as intended!
118118
.c-heading__content {
119+
color: inherit;
119120
font: inherit;
120121
}
121122

src/components/heading/heading.stories.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ import demo from './demo/demo.twig';
5050
options: ['', 'light'],
5151
},
5252
},
53+
class: {
54+
type: 'string',
55+
description: 'If necessary, additional classes can be added to headings.',
56+
},
5357
}}
5458
parameters={{
5559
docs: {

0 commit comments

Comments
 (0)