Skip to content

Commit fd22f7a

Browse files
committed
Add banner text color
1 parent 5246e66 commit fd22f7a

File tree

7 files changed

+25
-4
lines changed

7 files changed

+25
-4
lines changed

docs/overviews/overview-advertisers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use_banner: true
77
banner_title: UID2 Overview for Advertisers
88
banner_description: Upgrade campaign activation with Unified ID 2.0.
99
banner_icon: 'advertisers'
10+
banner_text_color: ''
11+
banner_text_color_dark: ''
1012
banner_background_color: ''
1113
banner_background_color_dark: ''
1214
displayed_sidebar: sidebarAdvertisers

docs/overviews/overview-data-providers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use_banner: true
77
banner_title: UID2 Overview for Data Providers
88
banner_description: An identity solution for the future.
99
banner_icon: 'dataProviders'
10+
banner_text_color: ''
11+
banner_text_color_dark: ''
1012
banner_background_color: ''
1113
banner_background_color_dark: ''
1214
displayed_sidebar: sidebarDataProviders

docs/overviews/overview-dsps.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use_banner: true
77
banner_title: UID2 Overview for DSPs
88
banner_description: Enable data strategies with a more durable identifier.
99
banner_icon: 'dsps'
10+
banner_text_color: ''
11+
banner_text_color_dark: ''
1012
banner_background_color: ''
1113
banner_background_color_dark: ''
1214
displayed_sidebar: sidebarDSPs

docs/overviews/overview-publishers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use_banner: true
77
banner_title: UID2 Overview for Publishers
88
banner_description: Maintain audience targeting in the ever-changing advertising industry for better impression monetization and more relevance.
99
banner_icon: 'publishers'
10+
banner_text_color: ''
11+
banner_text_color_dark: ''
1012
banner_background_color: ''
1113
banner_background_color_dark: ''
1214
displayed_sidebar: sidebarPublishers

src/components/DocsBanner/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ type DocsBannerProps = {
1919
title: string;
2020
description: string;
2121
icon?: string;
22+
textColor?: string;
23+
textColorDark?: string;
2224
backgroundColor?: string;
2325
backgroundColorDark?: string;
2426
};
@@ -27,11 +29,16 @@ export default function DocsBanner({
2729
title,
2830
description,
2931
icon,
32+
textColor,
33+
textColorDark,
3034
backgroundColor,
3135
backgroundColorDark,
3236
}: DocsBannerProps): JSX.Element {
3337
const Icon = (icon && icons[icon]) || icons.documents;
3438

39+
textColor ||= "var(--c-eleven-o-clock)"; // default banner text color
40+
textColorDark ||= "var(--c-off-white)"; // default banner text color dark theme
41+
3542
backgroundColor ||= "var(--c-dirty-socks)"; // default banner bg color
3643
backgroundColorDark ||= "var(--c-primary-gray)"; // default banner bg color dark theme
3744

@@ -46,6 +53,8 @@ export default function DocsBanner({
4653
className={clsx(styles.docsBanner)}
4754
style={
4855
{
56+
"--text-docs-banner": textColor,
57+
"--text-docs-banner-dark": textColorDark,
4958
"--bg-docs-banner": backgroundColor,
5059
"--bg-docs-banner-dark": backgroundColorDark,
5160
} as CSSProperties

src/components/DocsBanner/styles.module.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
h1,
1111
p {
12-
color: var(--c-eleven-o-clock);
12+
color: var(--text-docs-banner); // var is set in html styles
1313
text-align: center;
1414

1515
@media only screen and (min-width: 996px) {
@@ -38,7 +38,7 @@
3838

3939
h1,
4040
p {
41-
color: var(--c-off-white);
41+
color: var(--text-docs-banner-dark); // var is set in html styles
4242
}
4343
}
4444
}
@@ -55,10 +55,10 @@
5555
.icon {
5656
order: 1;
5757
margin-bottom: 1.3125rem;
58-
color: var(--c-eleven-o-clock);
58+
color: var(--text-docs-banner); // var is set in html styles
5959

6060
html[data-theme="dark"] & {
61-
color: var(--c-off-white);
61+
color: var(--text-docs-banner-dark); // var is set in html styles
6262
}
6363

6464
@media only screen and (min-width: 996px) {

src/theme/DocItem/Layout/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type CustomDocFrontMatter = DocFrontMatter & {
2222
banner_title?: string;
2323
banner_description?: string;
2424
banner_icon?: string;
25+
banner_text_color?: string;
26+
banner_text_color_dark?: string;
2527
banner_background_color?: string;
2628
banner_background_color_dark?: string;
2729
};
@@ -90,6 +92,8 @@ export default function DocItemLayout({ children }: Props): JSX.Element {
9092
title={bannerTitle}
9193
description={bannerDescription}
9294
icon={customFrontMatter.banner_icon}
95+
textColor={customFrontMatter.banner_text_color}
96+
textColorDark={customFrontMatter.banner_text_color_dark}
9397
backgroundColor={customFrontMatter.banner_background_color}
9498
backgroundColorDark={
9599
customFrontMatter.banner_background_color_dark

0 commit comments

Comments
 (0)