Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

theme.tsx

29 lines635 Bytes

1import React from 'react'
2​
3export const defaultTheme = {
4 background: '#0b1521',
5 backgroundAlt: '#132337',
6 foreground: 'white',
7 gray: '#3f4e60',
8 grayAlt: '#222e3e',
9 inputBackgroundColor: '#fff',
10 inputTextColor: '#000',
11 success: '#00ab52',
12 danger: '#ff0085',
13 active: '#006bff',
14 warning: '#ffb200',
16​
17interface ProviderProps {
18 theme: typeof defaultTheme
20​
21const ThemeContext = React.createContext(defaultTheme)
22​
23export function ThemeProvider({ theme, ...rest }: ProviderProps) {
24 return <ThemeContext.Provider value={theme} {...rest} />
26​
27export function useTheme() {
28 return React.useContext(ThemeContext)