fix : Pas besoin de theming

This commit is contained in:
Yaël Perret
2026-09-01 16:45:11 +02:00
parent 6affbef244
commit d4246aa2c8
9 changed files with 23 additions and 72 deletions

View File

@@ -1,24 +0,0 @@
import { type PropsWithChildren, useMemo } from 'react';
import { colors, glow, gradientDirection, gradients, palette } from './colors';
import spacing, { borderRadius } from './spacing';
import typography from './typography';
import { ThemeContext } from './useTheme';
export function ThemeProvider({ children }: PropsWithChildren) {
const value = useMemo(
() => ({
colors,
gradients,
glow,
gradientDirection,
palette,
typography,
spacing,
borderRadius,
}),
[],
);
return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
}

View File

@@ -1,28 +0,0 @@
import { createContext, useContext } from 'react';
import { colors, glow, gradientDirection, gradients, palette } from './colors';
import spacing, { borderRadius } from './spacing';
import typography from './typography';
export type ThemeContextValue = {
colors: typeof colors;
gradients: typeof gradients;
glow: typeof glow;
gradientDirection: typeof gradientDirection;
palette: typeof palette;
typography: typeof typography;
spacing: typeof spacing;
borderRadius: typeof borderRadius;
};
export const ThemeContext = createContext<ThemeContextValue | undefined>(undefined);
export const useTheme = () => {
const context = useContext(ThemeContext);
if (!context) {
throw new Error('useTheme must be used within a ThemeProvider');
}
return context;
};