Files
estim_control/src/context/ThemeColors.ts
2025-03-12 22:39:18 +08:00

24 lines
1.1 KiB
TypeScript

import { atomWithRefresh } from 'jotai/utils';
export const PrimaryColorAtom = atomWithRefresh(() =>
window.getComputedStyle(document.documentElement).getPropertyValue('--color-primary').trim(),
);
export const SecondaryColorAtom = atomWithRefresh(() =>
window.getComputedStyle(document.documentElement).getPropertyValue('--color-secondary').trim(),
);
export const TeritaryColorAtom = atomWithRefresh(() =>
window.getComputedStyle(document.documentElement).getPropertyValue('--color-tertiary').trim(),
);
export const ErrorColorAtom = atomWithRefresh(() =>
window.getComputedStyle(document.documentElement).getPropertyValue('--color-error').trim(),
);
export const GentleColorAtom = atomWithRefresh(() =>
window.getComputedStyle(document.documentElement).getPropertyValue('--color-gentle').trim(),
);
export const AggressiveColorAtom = atomWithRefresh(() =>
window.getComputedStyle(document.documentElement).getPropertyValue('--color-aggressive').trim(),
);
export const DefensiveColorAtom = atomWithRefresh(() =>
window.getComputedStyle(document.documentElement).getPropertyValue('--color-defensive').trim(),
);