diff --git a/packages/styles/scss/components/card/_card.scss b/packages/styles/scss/components/card/_card.scss index c044e425dba..54e85a043af 100644 --- a/packages/styles/scss/components/card/_card.scss +++ b/packages/styles/scss/components/card/_card.scss @@ -569,6 +569,10 @@ align-items: center; } + svg { + color: $link-primary; + } + &[color-scheme='inverse'] .#{$c4d-prefix}-ce--card__footer--static { color: $link-inverse; } @@ -580,12 +584,6 @@ color: $link-inverse; } } - - &:hover { - ::slotted(svg[slot='icon']) { - color: $link-primary-hover; - } - } } // static card footer @@ -594,15 +592,13 @@ width: auto; justify-content: flex-start; - &:active, &:hover { - text-decoration: none; + color: $link-primary-hover; } - &:active { - ::slotted([slot='icon']) { - color: $text-primary; - } + &:active, + &:hover { + text-decoration: none; } &::after { diff --git a/packages/styles/scss/components/feature-section/_feature-section.scss b/packages/styles/scss/components/feature-section/_feature-section.scss index cf60d1eeee0..55091f9ecac 100644 --- a/packages/styles/scss/components/feature-section/_feature-section.scss +++ b/packages/styles/scss/components/feature-section/_feature-section.scss @@ -13,20 +13,12 @@ @use '../../globals/utils/aspect-ratio'; @use '../../globals/carbon-grid'; @use '../../globals/utils/ratio-base' as *; +@use '../../internal/callout/tokens' as *; @mixin feature-section { :host(#{$c4d-prefix}-feature-section) { display: block; outline: none; - - &[media-alignment='left'] { - ::slotted(#{$c4d-prefix}-card[link]) { - @include breakpoint-down(lg) { - position: relative; - right: 0; - } - } - } } .#{$prefix}--feature-section { @@ -69,6 +61,27 @@ } } + :host(#{$c4d-prefix}-feature-section[color-scheme='inverse']) + .#{$prefix}--feature-section__container { + background-color: $background-inverse; + + ::slotted([slot='eyebrow']), + ::slotted([slot='heading']), + ::slotted([slot='copy']) { + color: $text-inverse; + } + } + + :host(#{$c4d-prefix}-feature-section[color-scheme='cyan']) + .#{$prefix}--feature-section__container { + background-color: $callout-background-cyan; + } + + :host(#{$c4d-prefix}-feature-section[color-scheme='purple']) + .#{$prefix}--feature-section__container { + background-color: $callout-background-purple; + } + .#{$prefix}--feature-section__body { position: relative; padding-top: $spacing-07; @@ -107,6 +120,7 @@ position: relative; padding-left: 0; padding-right: 0; + border: 1px solid $border-subtle-01; ::slotted(#{$c4d-prefix}-image) { overflow: hidden; @@ -127,13 +141,13 @@ ::slotted(#{$c4d-prefix}-card-eyebrow) { display: inline-block; - margin-bottom: $spacing-05; + margin-bottom: $spacing-03; } ::slotted([slot='footer']) { position: absolute; right: 0; - bottom: 0; + bottom: -1px; width: 75%; height: auto; diff --git a/packages/web-components/src/components/card/card-footer.ts b/packages/web-components/src/components/card/card-footer.ts index 57cb86526df..69ce3e625e4 100644 --- a/packages/web-components/src/components/card/card-footer.ts +++ b/packages/web-components/src/components/card/card-footer.ts @@ -88,7 +88,7 @@ class C4DCardFooter extends C4DLinkWithIcon { * The color scheme. */ @property({ attribute: 'color-scheme', reflect: true }) - colorScheme = BASIC_COLOR_SCHEME.REGULAR; + colorScheme = ''; /** * The `href` in parent ``. diff --git a/packages/web-components/src/components/card/card.ts b/packages/web-components/src/components/card/card.ts index 8793b2250fe..3f566abba43 100644 --- a/packages/web-components/src/components/card/card.ts +++ b/packages/web-components/src/components/card/card.ts @@ -189,10 +189,10 @@ class C4DCard extends CTAMixin(StableSelectorMixin(CDSLink)) { * The color scheme. * A typical use case of using another color scheme of card is having a "CTA" purpose of card at the last in card group. * - * Color scheme options are: "inverse" and "light" + * Color scheme options are: "inverse" and "regular" */ @property({ attribute: 'color-scheme', reflect: true }) - colorScheme = BASIC_COLOR_SCHEME.REGULAR; + colorScheme = ''; /** * Link `href`. diff --git a/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.react.tsx b/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.react.tsx index ca1835ad451..cf334974bc0 100644 --- a/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.react.tsx +++ b/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.react.tsx @@ -28,8 +28,8 @@ import imgLg1x1 from '../../../../../storybook-images/assets/1312/fpo--1x1--1312 import imgMd4x3 from '../../../../../storybook-images/assets/960/fpo--4x3--960x720--002.jpg'; import imgSm1x1 from '../../../../../storybook-images/assets/720/fpo--1x1--720x720--002.jpg'; import imgXs1x1 from '../../../../../storybook-images/assets/320/fpo--1x1--320x320--002.jpg'; -import { MEDIA_ALIGNMENT } from '../defs'; import { CTA_TYPE } from '../../cta/defs'; +import { COLOR_SCHEME } from '../defs'; import textNullable from '../../../../.storybook/knob-text-nullable'; import readme from './README.stories.react.mdx'; @@ -41,13 +41,15 @@ import { types, } from '../../cta/__stories__/ctaTypeConfig'; -const mediaAlignment = { - [`Left`]: MEDIA_ALIGNMENT.LEFT, - [`Right`]: MEDIA_ALIGNMENT.RIGHT, +const colorSchemeTypes = { + [`${COLOR_SCHEME.REGULAR}`]: COLOR_SCHEME.REGULAR, + [`${COLOR_SCHEME.INVERSE}`]: COLOR_SCHEME.INVERSE, + [`${COLOR_SCHEME.PURPLE}`]: COLOR_SCHEME.PURPLE, + [`${COLOR_SCHEME.CYAN}`]: COLOR_SCHEME.CYAN, }; export const Default = (args) => { - const { alt, eyebrow, heading, copy, href, ctaType, mediaAlign, defaultSrc } = + const { alt, colorScheme, eyebrow, heading, copy, href, ctaType, defaultSrc } = args?.FeatureSection ?? {}; let videoFooterCopy; @@ -59,7 +61,7 @@ export const Default = (args) => { } return ( - + { link slot="footer" href={href} - cta-type={ctaType} - color-scheme="inverse"> + cta-type={ctaType}> Try a free virtual business framing session with IBM Garage @@ -108,10 +109,10 @@ Default.story = { ); return { - mediaAlign: select( - 'Media Alignment', - mediaAlignment, - MEDIA_ALIGNMENT.RIGHT + colorScheme: select( + 'Color scheme:', + colorSchemeTypes, + COLOR_SCHEME.REGULAR ), eyebrow: textNullable( 'Card Eyebrow (optional)(eyebrow):', diff --git a/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.ts b/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.ts index 12f390c8390..0c1f9b4d5b1 100644 --- a/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.ts +++ b/packages/web-components/src/components/feature-section/__stories__/feature-section.stories.ts @@ -18,8 +18,8 @@ import imgLg1x1 from '../../../../../storybook-images/assets/1312/fpo--1x1--1312 import imgMd4x3 from '../../../../../storybook-images/assets/960/fpo--4x3--960x720--002.jpg'; import imgSm1x1 from '../../../../../storybook-images/assets/720/fpo--1x1--720x720--002.jpg'; import imgXs1x1 from '../../../../../storybook-images/assets/320/fpo--1x1--320x320--002.jpg'; -import { MEDIA_ALIGNMENT } from '../defs'; import { CTA_TYPE } from '../../cta/defs'; +import { COLOR_SCHEME } from '../defs'; import readme from './README.stories.mdx'; import textNullable from '../../../../.storybook/knob-text-nullable'; @@ -31,13 +31,15 @@ import { types, } from '../../cta/__stories__/ctaTypeConfig'; -const mediaAlignment = { - [`Left`]: MEDIA_ALIGNMENT.LEFT, - [`Right`]: MEDIA_ALIGNMENT.RIGHT, +const colorSchemeTypes = { + [`${COLOR_SCHEME.REGULAR}`]: COLOR_SCHEME.REGULAR, + [`${COLOR_SCHEME.INVERSE}`]: COLOR_SCHEME.INVERSE, + [`${COLOR_SCHEME.PURPLE}`]: COLOR_SCHEME.PURPLE, + [`${COLOR_SCHEME.CYAN}`]: COLOR_SCHEME.CYAN, }; export const Default = (args) => { - const { alt, mediaAlign, eyebrow, heading, copy, href, ctaType } = + const { alt, colorScheme, eyebrow, heading, copy, href, ctaType } = args?.['c4d-feature-section'] ?? {}; let videoFooterCopy; @@ -49,7 +51,7 @@ export const Default = (args) => { } return html` - + { > -
+
+
+
+
+
- -
-
-
-
-
- - - -
-
-
- -
-
-
- ` - : html` -
-
-
-
-
-
- - - -
-
-
-
-
- - + class="${prefix}--col-sm-4 ${prefix}--col-md-6 ${prefix}--col-lg-12"> + + +
- `} +
+
+ + +
+
+
`; }