diff options
Diffstat (limited to 'src/ui/c-button/c-button.theme.ts')
-rw-r--r-- | src/ui/c-button/c-button.theme.ts | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/ui/c-button/c-button.theme.ts b/src/ui/c-button/c-button.theme.ts index e2e1591..926cd11 100644 --- a/src/ui/c-button/c-button.theme.ts +++ b/src/ui/c-button/c-button.theme.ts @@ -2,7 +2,7 @@ import { darken, lighten } from '../color/color.models'; import { defineThemes } from '../theme/theme.models'; import { appThemes } from '../theme/themes'; -const createState = ({ +function createState({ textColor, backgroundColor, hoverBackground, @@ -10,20 +10,22 @@ const createState = ({ pressedBackground, pressedTextColor = textColor, }: { - textColor: string; - backgroundColor: string; - hoverBackground: string; - hoveredTextColor?: string; - pressedBackground: string; - pressedTextColor?: string; -}) => ({ - textColor, - backgroundColor, - hover: { textColor: hoveredTextColor, backgroundColor: hoverBackground }, - pressed: { textColor: pressedTextColor, backgroundColor: pressedBackground }, -}); + textColor: string + backgroundColor: string + hoverBackground: string + hoveredTextColor?: string + pressedBackground: string + pressedTextColor?: string +}) { + return { + textColor, + backgroundColor, + hover: { textColor: hoveredTextColor, backgroundColor: hoverBackground }, + pressed: { textColor: pressedTextColor, backgroundColor: pressedBackground }, + }; +} -const createTheme = ({ style }: { style: 'light' | 'dark' }) => { +function createTheme({ style }: { style: 'light' | 'dark' }) { const theme = appThemes[style]; return { @@ -95,7 +97,7 @@ const createTheme = ({ style }: { style: 'light' | 'dark' }) => { }), }, }; -}; +} export const { useTheme } = defineThemes({ dark: createTheme({ style: 'dark' }), |