Skip to content

Commit

Permalink
docs: complete dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Aug 16, 2024
1 parent be6c838 commit cd5a408
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 36 deletions.
8 changes: 4 additions & 4 deletions website/components/landingpage/Benchmark/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}

.title {
color: var(--title-color);
color: var(--landingpage-title-color);
text-align: center;
/* Style 10 */
font-family: 'Open Sans';
Expand All @@ -18,14 +18,14 @@
}

.desc {
color: var(--desc-color);
color: var(--landingpage-desc-color);
}

.bottomLink {
display: block;
margin-top: 16px;
font-size: 16px;
color: var(--title-color);
color: var(--landingpage-title-color);

&:hover {
color: var(--rp-c-link);
Expand All @@ -44,7 +44,7 @@
border-radius: 25px;
border: 2px solid var(--orange-gradient, #ff8b00);
// text
color: var(--title-color, #0b0c0e);
color: var(--landingpage-title-color, #0b0c0e);
text-align: center;
font-family: 'Open Sans';
font-size: 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
align-items: flex-start;
align-self: stretch;

filter: var(--landingpage-invert-filter);

.logo {
display: flex;
padding: 48px 36px 48px 36px;
Expand Down
7 changes: 1 addition & 6 deletions website/components/landingpage/BuiltWithRspack/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useDark } from 'rspress/runtime';
import { Link } from 'rspress/theme';
import { useI18n } from '../../../theme/i18n';
import amazonLogo from './assets/amazon.svg';
Expand All @@ -11,15 +10,11 @@ import styles from './index.module.scss';

const BuiltWithRsPack: React.FC = () => {
const t = useI18n();
const isDark = useDark();
return (
<div className={styles.container}>
<div className={styles.innerContainer}>
<h2 className={styles.title}>{t('builtWithRspack')}</h2>
<div
className={styles.logos}
style={isDark ? { filter: 'brightness(100)' } : {}}
>
<div className={styles.logos}>
<Link
className={`${styles.logo} ${styles.bitDevContainer}`}
href="https://bit.dev/"
Expand Down
11 changes: 6 additions & 5 deletions website/components/landingpage/FullyFeatured/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
gap: 32px;

.title {
color: var(--title-color);
color: var(--landingpage-title-color);
text-align: center;
/* Style 10 */
font-family: 'Open Sans';
Expand All @@ -29,7 +29,7 @@
}

.subtitle {
color: var(--desc-color);
color: var(--landingpage-desc-color);
text-align: center;
/* Style 11 */
font-family: 'Open Sans';
Expand Down Expand Up @@ -63,6 +63,7 @@
gap: 16px;

.icon {
filter: var(--landingpage-invert-filter);
display: flex;
width: 32px;
height: 32px;
Expand All @@ -78,7 +79,7 @@
gap: 8px;

.featureTitle {
color: var(--title-color);
color: var(--landingpage-title-color);
font-family: 'Open Sans';
font-size: 18px;
font-style: normal;
Expand All @@ -87,7 +88,7 @@
}

.featureDescription {
color: var(--desc-color);
color: var(--landingpage-desc-color);
font-family: 'Open Sans';
font-size: 15px;
font-style: normal;
Expand All @@ -109,7 +110,7 @@
border-radius: 25px;
border: 2px solid var(--orange-gradient, #ff8b00);
// text
color: var(--title-color);
color: var(--landingpage-title-color);
text-align: center;
font-family: 'Open Sans';
font-size: 16px;
Expand Down
3 changes: 0 additions & 3 deletions website/components/landingpage/FullyFeatured/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useState } from 'react';
import { useDark } from 'rspress/runtime';
import { Link } from 'rspress/theme';
import { useI18n, useI18nUrl } from '../../../theme/i18n';
import arrow from './assets/arrow.svg';
Expand Down Expand Up @@ -109,7 +108,6 @@ const FullyFeatured = () => {
];

const [isFolded, setIsFolded] = useState(true);
const isDark = useDark();

return (
<div className={styles.container}>
Expand All @@ -128,7 +126,6 @@ const FullyFeatured = () => {
src={icon}
alt={index.toString()}
className={styles.icon}
style={isDark ? { filter: 'invert(1)' } : {}}
/>
<div className={styles.featureContent}>
<h2 className={styles.featureTitle}>{title}</h2>
Expand Down
6 changes: 3 additions & 3 deletions website/components/landingpage/Hero/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}

.subtitle {
color: var(--title-color, #0b0c0e);
color: var(--landingpage-title-color, #0b0c0e);
text-align: center;
font-family: 'Open Sans';
font-size: 50px;
Expand All @@ -50,7 +50,7 @@
}

.description {
color: var(--desc-color, #6b7075);
color: var(--landingpage-desc-color, #6b7075);
text-align: center;
/* Style 5 */
font-family: 'Open Sans';
Expand Down Expand Up @@ -104,7 +104,7 @@
border: 2px solid var(--orange-gradient, #ff8b00);

// text
color: var(--title-color, #0b0c0e);
color: var(--landingpage-title-color, #0b0c0e);
text-align: center;
font-family: 'Open Sans';
font-size: 16px;
Expand Down
4 changes: 1 addition & 3 deletions website/components/landingpage/Hero/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { useCallback } from 'react';
import { useDark, useLang, useNavigate } from 'rspress/runtime';
import { useNavigate } from 'rspress/runtime';
import { useI18n, useI18nUrl } from '../../../theme/i18n';
import styles from './index.module.scss';

const Hero = () => {
const isDark = useDark();

const tUrl = useI18nUrl();
const t = useI18n();

Expand Down
8 changes: 4 additions & 4 deletions website/components/landingpage/ToolStack/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
gap: 32px;
align-self: stretch;
.title {
color: var(--title-color);
color: var(--landingpage-title-color);
text-align: center;

/* Style 10 */
Expand All @@ -35,7 +35,7 @@
}

.description {
color: var(--desc-color);
color: var(--landingpage-desc-color);
text-align: center;

/* Style 11 */
Expand Down Expand Up @@ -80,7 +80,7 @@
}

.toolTitle {
color: var(--title-color);
color: var(--landingpage-title-color);
text-align: center;
font-family: 'Open Sans';
font-size: 22px;
Expand All @@ -90,7 +90,7 @@
}

.toolDescription {
color: var(--desc-color);
color: var(--landingpage-desc-color);
text-align: center;
font-family: 'Open Sans';
font-size: 15px;
Expand Down
4 changes: 2 additions & 2 deletions website/components/landingpage/WhyRspack/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
gap: 8px;

.featureTitle {
color: var(--title-color);
color: var(--landingpage-title-color);
font-family: 'Open Sans';
font-size: 18px;
font-style: normal;
Expand All @@ -104,7 +104,7 @@
}

.featureDescription {
color: var(--desc-color);
color: var(--landingpage-desc-color);
font-family: 'Open Sans';
font-size: 16px;
font-style: normal;
Expand Down
11 changes: 7 additions & 4 deletions website/components/landingpage/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
:global {
html:not(.dark) {
--title-color: #0b0c0e;
--desc-color: #6b7075;
--landingpage-title-color: #0b0c0e;
--landingpage-desc-color: #6b7075;
--landingpage-invert-filter: none;

--why-rspack-card-stroke: #e6e8ea;
--why-rspack-card-gradient: var(
Expand All @@ -14,8 +15,10 @@
}

html.dark {
--title-color: white;
--desc-color: #c6cacd;
--landingpage-title-color: white;
--landingpage-desc-color: #c6cacd;

--landingpage-invert-filter: invert(1);

--why-rspack-card-stroke: #23272f;
--why-rspack-card-gradient: var(
Expand Down
2 changes: 0 additions & 2 deletions website/components/landingpage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useEffect, useMemo } from 'react';
import { useDark } from 'rspress/runtime';
import BackgroundUrl from './Background.simple.png';
import { Benchmark } from './Benchmark';
import BuiltWithRspack from './BuiltWithRspack';
Expand Down

0 comments on commit cd5a408

Please sign in to comment.