diff --git a/packages/styles/scss/components/feature-card-block-medium/_feature-card-block-medium.scss b/packages/styles/scss/components/feature-card-block-medium/_feature-card-block-medium.scss index 592bb8c738c..c8f20b1a3ab 100644 --- a/packages/styles/scss/components/feature-card-block-medium/_feature-card-block-medium.scss +++ b/packages/styles/scss/components/feature-card-block-medium/_feature-card-block-medium.scss @@ -22,13 +22,18 @@ } .#{$prefix}--feature-card-block-medium__heading, - ::slotted(#{$dds-prefix}-feature-card-block-medium-heading) { + ::slotted(#{$dds-prefix}-card-heading) { @include carbon--type-style('expressive-heading-04', true); display: block; margin-bottom: $carbon--spacing-07; } + ::slotted(#{$dds-prefix}-card-heading) { + width: auto; + max-width: none; + } + &:focus { outline: none; } diff --git a/packages/styles/scss/components/feature-card/_feature-card.scss b/packages/styles/scss/components/feature-card/_feature-card.scss index 840b6ecfd84..6f36e91d09a 100644 --- a/packages/styles/scss/components/feature-card/_feature-card.scss +++ b/packages/styles/scss/components/feature-card/_feature-card.scss @@ -32,7 +32,8 @@ outline-offset: 2px; } - .#{$prefix}--card__heading { + .#{$prefix}--card__heading, + ::slotted(#{$dds-prefix}-card-heading) { margin-bottom: $layout-03; } } diff --git a/packages/web-components/src/components/card/card-heading.ts b/packages/web-components/src/components/card/card-heading.ts index ddb8a5e8662..8a7c9dd5b19 100644 --- a/packages/web-components/src/components/card/card-heading.ts +++ b/packages/web-components/src/components/card/card-heading.ts @@ -25,6 +25,16 @@ class DDSCardHeading extends LitElement { @property({ reflect: true }) slot = 'heading'; + connectedCallback() { + if (!this.hasAttribute('role')) { + this.setAttribute('role', 'heading'); + } + if (!this.hasAttribute('aria-level')) { + this.setAttribute('aria-level', '3'); + } + super.connectedCallback(); + } + render() { return html` diff --git a/packages/web-components/src/components/card/card.scss b/packages/web-components/src/components/card/card.scss index b96d073ce9e..e89361ca11f 100644 --- a/packages/web-components/src/components/card/card.scss +++ b/packages/web-components/src/components/card/card.scss @@ -34,7 +34,7 @@ .#{$prefix}--card__pictogram { display: flex; - .#{$prefix}--card__heading { + ::slotted(#{$dds-prefix}-card-heading) { margin-bottom: 0; flex: 1; display: flex; @@ -44,7 +44,7 @@ &[pictogram-placement='bottom'] { .#{$prefix}--card__pictogram { - .#{$prefix}--card__heading { + ::slotted(#{$dds-prefix}-card-heading) { align-items: flex-start; } } diff --git a/packages/web-components/src/components/dotcom-shell/__stories__/dotcom-shell.stories.ts b/packages/web-components/src/components/dotcom-shell/__stories__/dotcom-shell.stories.ts index 8150e42a3cd..7f3e84c3508 100644 --- a/packages/web-components/src/components/dotcom-shell/__stories__/dotcom-shell.stories.ts +++ b/packages/web-components/src/components/dotcom-shell/__stories__/dotcom-shell.stories.ts @@ -183,8 +183,8 @@ const StoryContent = () => html` srcset="https://fpoimg.com/600x600?text=1:1&bg_color=ee5396&text_color=161616" > - scelerisque purus - Elementum nibh tellus molestie nunc? + scelerisque purus + Elementum nibh tellus molestie nunc?

Habitant morbi tristique senectus et netus et malesuada fames. Habitant morbu tristique.

${ArrowRight20({ slot: 'icon' })}