Skip to content

Commit 0f49d96

Browse files
authored
Fix Dark Mode issue (#34)
1 parent fc3e117 commit 0f49d96

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/components/ArticleTeaser.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import Link from '@docusaurus/Link';
22
import {ArticleTeaserProps} from "@site/src/types/ArticleTeaserProps";
3+
import { useColorMode } from "@docusaurus/theme-common";
34

45
export default function ArticleTeaser(props: ArticleTeaserProps) {
6+
const { isDarkTheme } = useColorMode();
57
return (
68
<article>
7-
<Link to={props.slug} className="group border border-neutral-200 dark:border-white/5 filter backdrop-blur-xl rounded-lg block p-8 h-full">
9+
<Link to={props.slug} className={`${ isDarkTheme ? "dark:bg-neutral-900" : "bg-white/50"} group border border-neutral-200 dark:border-white/5 filter backdrop-blur-xl rounded-lg block p-8 h-full`}>
810
<div className=" relative">
911
<h3 className="mt-0 text-lg font-semibold leading-6 group-hover:text-amber-500 !line-clamp-2 h-12">
1012
{props.title}

src/components/sections/Offering.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Row from "../../components/Row";
44
import Section from "../../components/Section";
55
import SectionIntro from "../../components/SectionIntro";
66
import { Button } from "../../components/Button";
7-
// import { useColorMode } from "@docusaurus/theme-common";
7+
import { useColorMode } from "@docusaurus/theme-common";
88

99
let cloudFeatures = [
1010
{ src: "/img/icons8-gdpr.svg", title: "Fully DSGVO and GDPR compliant", key: "compilence" },
@@ -16,7 +16,7 @@ let cloudFeatures = [
1616
];
1717

1818
export default function Offering() {
19-
// const colorMode = useColorMode();
19+
const { isDarkTheme } = useColorMode();
2020
return (
2121
<Section id="cloud-offering" className="pb-0 sm:pb-20 dark:bg-neutral-900 ">
2222
<Row className=" overflow-clip">
@@ -66,7 +66,7 @@ export default function Offering() {
6666
<div className="aspect-w-16 aspect-h-9 relative sm:ml-10 rounded-lg overflow-clip sm:-mr-96">
6767
<img
6868
className="w-full object-cover h-full"
69-
src="/img/browser-mockup-light.png"
69+
src={isDarkTheme ? "/img/browser-mockup-dark.png" : "/img/browser-mockup-light.png"}
7070
alt="Screenshot of the user interface of the metalstack.cloud management console."
7171
/>
7272
</div>

static/img/browser-mockup-dark.png

-2.36 KB
Loading
-521 Bytes
Loading

0 commit comments

Comments
 (0)