Skip to content

Commit

Permalink
fix: improve color contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
Haidong Xu committed Dec 15, 2024
1 parent 4e56b4f commit e1483e7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/components/About/ExternalLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import React, { ReactNode } from 'react';

function ExternalLink({ href, children, className }: { href: string; children: ReactNode; className?: string }) {
return (
<Link isExternal size="lg" underline="hover" href={href} className={clsx('inline', className)}>
<Link
isExternal
size="lg"
underline="hover"
href={href}
className={clsx('inline text-link dark:text-link', className)}
>
{children}
</Link>
);
Expand Down
8 changes: 7 additions & 1 deletion src/components/About/StyledLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ function StyledLink({
isInternal?: boolean;
}) {
return (
<Link isExternal={!isInternal} size="lg" underline="hover" href={href} className={clsx('inline', className)}>
<Link
isExternal={!isInternal}
size="lg"
underline="hover"
href={href}
className={clsx('inline text-link dark:text-link', className)}
>
{children}
</Link>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/Sidebar/ThemeSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function ThemeSwitch({ isIconOnly = false }: ThemeSwitchProps) {
<div className="flex items-center justify-between gap-4 w-full ml-1">
{!isIconOnly && <small>Theme</small>}
<Switch
aria-label="theme-switch"
classNames={{
wrapper: ['bg-yellow-200', 'group-data-[selected=true]:bg-primary'],
thumb: ['bg-yellow-400', 'group-data-[selected=true]:bg-black'],
Expand Down
8 changes: 7 additions & 1 deletion src/components/Topbar/Topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
NavbarMenuItem,
NavbarMenuToggle,
} from '@nextui-org/react';
import clsx from 'clsx';
import { usePathname } from 'next/navigation';
import { useState } from 'react';

Expand All @@ -32,7 +33,12 @@ export function Topbar() {
<NavbarContent className="hidden md:flex gap-4" justify="center">
{pageLinks.map((item) => (
<NavbarItem key={item.label} isActive={pathname === item.href}>
<Link href={item.href} className="text-lg" color={pathname === item.href ? 'primary' : 'foreground'}>
<Link
href={item.href}
className={clsx('text-lg text-black dark:text-white', {
'text-link dark:text-link': pathname === item.href,
})}
>
{item.label}
</Link>
</NavbarItem>
Expand Down
2 changes: 2 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ const config = {
chartsLegendBackground: '#F5F5F5',
chartsXAxisLine: '#a6a6a6',
chartsGridLine: '#E6E6E6',
link: '#005999',
},
},
dark: {
Expand Down Expand Up @@ -274,6 +275,7 @@ const config = {
chartsGridLine: '#424242',
chartForecast: '#0e6983',
nutritionNotAnalyzed: '#A69F9F',
link: '#0A9BFF',
},
},
},
Expand Down

0 comments on commit e1483e7

Please sign in to comment.