pass theme and colorscheme in tss context to avoid repetitions (#1241)

This commit is contained in:
Athou
2024-02-12 07:37:28 +01:00
parent 3efeed6c85
commit b6107c3330
9 changed files with 48 additions and 95 deletions

View File

@@ -1,11 +1,14 @@
import { useMantineTheme } from "@mantine/core"
import { useColorScheme } from "hooks/useColorScheme"
import { createTss } from "tss-react"
const useContext = () => {
// return anything here that will be accessible in tss.create()
// we don't need anything right now
return {}
const theme = useMantineTheme()
const colorScheme = useColorScheme()
return { theme, colorScheme }
}
export const { tss } = createTss({ useContext })
export const useStyles = tss.create({})