Skip to content

Commit 2172242

Browse files
chore: Update dark theme logos styling (Fixes #1209) (#1213)
* chore: Update dark theme logos styling * replaced var with let * Replaced var with let - 2 * Applied suggestions from code review Co-authored-by: Gabriel Jablonski <[email protected]> * changed in approach. added a new key in Svg component. * ran prettier --------- Co-authored-by: Gabriel Jablonski <[email protected]>
1 parent 143221a commit 2172242

File tree

7 files changed

+30
-7
lines changed

7 files changed

+30
-7
lines changed

docs/src/components/AdsContainer/styles.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
width: 100%;
1212
max-width: 341px;
1313
}
14-
}
14+
}

docs/src/components/BannerSponsor/styles.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818

1919
.sponsor-banner-silver {
2020
max-width: 163px;
21-
}
21+
}

docs/src/components/HomepageFeatures/index.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable react/require-default-props */
12
/* eslint-disable import/no-unresolved */
23
/* eslint-disable @typescript-eslint/no-var-requires */
34
/* eslint-disable global-require */
@@ -9,6 +10,7 @@ type FeatureItem = {
910
title: string
1011
Svg: React.ComponentType<React.ComponentProps<'svg'>>
1112
description: JSX.Element
13+
allowsDarkMode?: boolean
1214
}
1315

1416
const FeatureList: FeatureItem[] = [
@@ -28,6 +30,7 @@ const FeatureList: FeatureItem[] = [
2830
community to always try to improve ReactTooltip.
2931
</>
3032
),
33+
allowsDarkMode: true,
3134
},
3235
{
3336
title: 'Focus on What Matters',
@@ -41,11 +44,16 @@ const FeatureList: FeatureItem[] = [
4144
},
4245
]
4346

44-
function Feature({ title, Svg, description }: FeatureItem) {
47+
function Feature({ title, Svg, description, allowsDarkMode }: FeatureItem) {
4548
return (
4649
<div className={clsx('col col--4')}>
4750
<div className="text--center">
48-
<Svg className={styles.featureSvg} role="img" />
51+
<Svg
52+
className={clsx(styles.featureSvg, {
53+
[styles.svgDarkMode]: allowsDarkMode,
54+
})}
55+
role="img"
56+
/>
4957
</div>
5058
<div className="text--center padding-horiz--md">
5159
<h3>{title}</h3>

docs/src/components/HomepageFeatures/styles.module.css

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
height: 200px;
1010
width: 200px;
1111
}
12+
13+
html[data-theme='dark'] .svgDarkMode {
14+
fill: #fff;
15+
}

docs/src/components/HomepageSponsored/index.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type FeatureItem = {
1414
// eslint-disable-next-line react/no-unused-prop-types
1515
eventTitle?: string
1616
link: string
17+
allowsDarkMode?: boolean
1718
}
1819

1920
type SponsorItem = FeatureItem & {
@@ -30,6 +31,7 @@ const FeatureList: FeatureItem[] = [
3031
title: 'Algolia',
3132
Svg: require('@site/static/img/Algolia-logo.svg').default,
3233
link: 'https://docsearch.algolia.com/',
34+
allowsDarkMode: true,
3335
},
3436
]
3537

@@ -50,12 +52,17 @@ const SponsorList: SponsorItem[] = [
5052
// },
5153
]
5254

53-
function Feature({ title, Svg, link }: FeatureItem) {
55+
function Feature({ title, Svg, link, allowsDarkMode }: FeatureItem) {
5456
return (
5557
<div className={clsx('col col--6')}>
5658
<div className="text--center">
5759
<a href={link} title={title} target="_blank" rel="noreferrer" aria-label={title}>
58-
<Svg className={styles.featureSvg} role="img" />
60+
<Svg
61+
className={clsx(styles.featureSvg, {
62+
[styles.svgDarkMode]: allowsDarkMode,
63+
})}
64+
role="img"
65+
/>
5966
</a>
6067
</div>
6168
</div>

docs/src/components/HomepageSponsored/styles.module.css

+4
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@
2929
width: 100%;
3030
}
3131
}
32+
33+
html[data-theme='dark'] .svgDarkMode {
34+
fill: #fff;
35+
}

docs/static/img/Algolia-logo.svg

+1-1
Loading

0 commit comments

Comments
 (0)