diff --git a/src/components/ContentList/ContentList.scss b/src/components/ContentList/ContentList.scss index 350340bcc..163bf3aff 100644 --- a/src/components/ContentList/ContentList.scss +++ b/src/components/ContentList/ContentList.scss @@ -7,6 +7,17 @@ $iconSizeS: 20px; $iconSizeXS: 18px; $marginIconSizeS: 2px; $marginIconSizeL: 1px; +$lightPrimary: var(--g-color-text-light-primary); +$darkPrimary: var(--g-color-text-dark-primary); +$darkSecondary: var(--g-color-text-dark-secondary); + +@mixin content-link($baseColor: $primary, $hoverColor: $secondary) { + color: $baseColor; + text-decoration: underline; + &:hover { + color: $hoverColor; + } +} #{$block} { &_size_l { @@ -84,6 +95,34 @@ $marginIconSizeL: 1px; } } + &_theme_light { + #{$block}__item { + *, + .yfm, + .yfm * { + color: $darkPrimary; + } + + .yfm a { + @include content-link($darkPrimary, $darkSecondary); + } + } + } + + &_theme_dark { + #{$block}__item { + *, + .yfm, + .yfm * { + color: $lightPrimary; + } + + .yfm a { + @include content-link($lightPrimary, $lightSecondary); + } + } + } + &__icon { display: block; } diff --git a/src/components/ContentList/ContentList.tsx b/src/components/ContentList/ContentList.tsx index 428981153..258912824 100644 --- a/src/components/ContentList/ContentList.tsx +++ b/src/components/ContentList/ContentList.tsx @@ -24,11 +24,11 @@ function getHeadingLevel(size: ContentSize) { } } -const ContentList = ({list, size = 'l', qa}: ContentListProps & QAProps) => { +const ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => { const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']); return ( -
+
{list?.map((item) => { const {icon, title, text} = item; return ( diff --git a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png index 68c77c8be..d669a910c 100644 Binary files a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png and b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-chromium-linux.png differ diff --git a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png index ae1114e59..f118521fe 100644 Binary files a/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png and b/src/sub-blocks/BackgroundCard/__snapshots__/BackgroundCard.visual.test.tsx-snapshots/BackgroundCard-render-stories-CardThemes-light-webkit-linux.png differ diff --git a/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx b/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx index 31eafca5a..8a629309a 100644 --- a/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx +++ b/src/sub-blocks/BackgroundCard/__stories__/BackgroundCard.stories.tsx @@ -19,6 +19,13 @@ const transformedContentList = data.common.list.map((item) => { }; }) as ContentItemProps[]; +const transformedContentDarkList = data.common.darkList.map((item) => { + return { + ...item, + text: item?.text && yfmTransform(item.text), + }; +}) as ContentItemProps[]; + const getPaddingBottomTitle = (padding: string) => data.paddings.title.replace('{{padding}}', padding); @@ -78,7 +85,12 @@ const CardThemesTemplate: StoryFn<{items: BackgroundCardProps[]}> = (args) => (
{args.items.map((item, i) => (
- +
))}
diff --git a/src/sub-blocks/BackgroundCard/__stories__/data.json b/src/sub-blocks/BackgroundCard/__stories__/data.json index 95e0ba877..4a84d5f45 100644 --- a/src/sub-blocks/BackgroundCard/__stories__/data.json +++ b/src/sub-blocks/BackgroundCard/__stories__/data.json @@ -35,6 +35,21 @@ "title": "Lorem ipsum ipsum" } ], + "darkList": [ + { + "icon": "/story-assets/icon_1_dark.svg", + "title": "Lorem ipsum", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation." + }, + { + "icon": "/story-assets/icon_2_dark.svg", + "text": "**Ut enim ad minim veniam** [quis nostrud](https://example.com) exercitation." + }, + { + "icon": "/story-assets/icon_3_dark.svg", + "title": "Lorem ipsum ipsum" + } + ], "buttons": [ { "text": "Button\r", diff --git a/src/sub-blocks/Content/Content.scss b/src/sub-blocks/Content/Content.scss index 5388fc34d..519b3c823 100644 --- a/src/sub-blocks/Content/Content.scss +++ b/src/sub-blocks/Content/Content.scss @@ -130,9 +130,6 @@ $darkSecondary: var(--g-color-text-dark-secondary); #{$block}__title *, #{$block}__text .yfm, #{$block}__text .yfm *, - #{$block}__list *, - #{$block}__list .yfm, - #{$block}__list .yfm *, #{$block}__links a { color: $lightPrimary; } @@ -148,8 +145,7 @@ $darkSecondary: var(--g-color-text-dark-secondary); } } - #{$block}__text, - #{$block}__list { + #{$block}__text { .yfm a { @include content-link($lightPrimary, $lightSecondary); } @@ -167,9 +163,6 @@ $darkSecondary: var(--g-color-text-dark-secondary); #{$block}__title *, #{$block}__text .yfm, #{$block}__text .yfm *, - #{$block}__list *, - #{$block}__list .yfm, - #{$block}__list .yfm *, #{$block}__links a { color: $darkPrimary; } @@ -185,8 +178,7 @@ $darkSecondary: var(--g-color-text-dark-secondary); } } - #{$block}__text, - #{$block}__list { + #{$block}__text { .yfm a { @include content-link($darkPrimary, $darkSecondary); } diff --git a/src/sub-blocks/Content/Content.tsx b/src/sub-blocks/Content/Content.tsx index dc75ca68f..230bc45aa 100644 --- a/src/sub-blocks/Content/Content.tsx +++ b/src/sub-blocks/Content/Content.tsx @@ -80,7 +80,7 @@ const Content = (props: ContentProps) => { )} {list?.length ? (
- +
) : null} {additionalInfo && (