Skip to content

Commit be18ee7

Browse files
committed
Fix dark mode logo and markdown link colors
Use a cropped white SVG logo without the black background rect for dark mode. Add theme-aware link color to the markdown renderer so links in news posts use the primary color instead of the harsh default blue.
1 parent 8b1bc2a commit be18ee7

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
Lines changed: 10 additions & 0 deletions
Loading

frontend/src/components/app-layout/NavBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function NavBar() {
2828
const isDark = theme.palette.mode === "dark";
2929

3030
const logoSrc = isDark
31-
? "/gpu-mode-logo/white.svg"
31+
? "/gpu-mode-logo/white-cropped.svg"
3232
: "/gpu-mode-logo/black-cropped.svg";
3333

3434
const cycleMode = () => {

frontend/src/components/markdown-renderer/MarkdownRenderer.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react";
22
import ReactMarkdown from "react-markdown";
33
import rehypeRaw from "rehype-raw";
44
import remarkGfm from "remark-gfm";
5+
import { useTheme } from "@mui/material/styles";
56

67
type MarkdownRendererProps = {
78
content: string;
@@ -44,11 +45,18 @@ const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({
4445
}) => {
4546
const mergedImageProps = { ...defaultImageProps, ...imageProps };
4647
const { align, ...styleProps } = mergedImageProps;
48+
const theme = useTheme();
4749
return (
4850
<ReactMarkdown
4951
remarkPlugins={[remarkGfm]}
5052
rehypePlugins={[rehypeRaw]}
5153
components={{
54+
a: ({ node, ...props }) => (
55+
<a
56+
style={{ color: theme.palette.primary.main, textDecoration: "none" }}
57+
{...props}
58+
/>
59+
),
5260
figure: ({ node, ...props }) => (
5361
<figure style={{ textAlign: align, margin: "1.5rem 0" }} {...props} />
5462
),

0 commit comments

Comments
 (0)