From 30a206867d5f4b19d9cdfcc540f0286405b6d984 Mon Sep 17 00:00:00 2001 From: Adam Tirella Date: Thu, 29 Feb 2024 11:01:36 -0800 Subject: [PATCH] fix(card): Do not apply text color to slotted footer items (#8839) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Related Issue:** #8855 ## Summary This removes the styles set on footer elements, as it could unintentionally style components slotted directly that themselves do not ensure a text color is set. The workaround is to add a wrapping div that itself is slotted in `footer-end` or `footer-start`. Screenshot 2024-02-27 at 12 01 36 PM The `heading` and `description` (and deprecated `title` and `subtitle`) should keep their default text styles as these are most often text slotted directly. In the future it might be good to make these string properties to incentivize consistency, keeping the option to slot in rich content like links, icons, etc., when needed. --- .../src/components/card/card.scss | 2 -- .../src/components/card/card.stories.ts | 22 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/calcite-components/src/components/card/card.scss b/packages/calcite-components/src/components/card/card.scss index 6b80ccd8fe7..8b6b3fdfb9a 100644 --- a/packages/calcite-components/src/components/card/card.scss +++ b/packages/calcite-components/src/components/card/card.scss @@ -153,12 +153,10 @@ @include slotted("footer-start", "*") { @apply text-n2-wrap self-center; margin-inline-end: auto; - color: var(--calcite-color-text-3); } @include slotted("footer-end", "*") { @apply text-n2-wrap self-center; - color: var(--calcite-color-text-3); } .checkbox-wrapper-deprecated { diff --git a/packages/calcite-components/src/components/card/card.stories.ts b/packages/calcite-components/src/components/card/card.stories.ts index d5436c665de..7bb6b24fcb1 100644 --- a/packages/calcite-components/src/components/card/card.stories.ts +++ b/packages/calcite-components/src/components/card/card.stories.ts @@ -231,6 +231,28 @@ export const deprecatedSlotsSelectable_TestOnly = (): string => html` `; +export const slottedFooterItems_TestOnly = (): string => html` +
+ + ${thumbnailHtml} +

Portland Businesses

+ by + example_user + +
+ Created: Apr 22, 2019 +
+ Updated: Dec 9, 2019 +
+ View Count: 0 +
+ Recent + Recreation +
+
+`; + export const darkModeRTL_TestOnly = (): string => html`
${thumbnailHtml}${titleHtml}${footerStartTextHtml}${footerEndButtonsHtml}