From d6cfbe982fb30b54be57f8735356ec19d68273ba Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:07:37 +1000 Subject: [PATCH] feat(ui): tweak light mode colors, buttons pop --- .../components/IAIMantineMultiSelect.tsx | 7 +- .../common/components/IAIMantineSelect.tsx | 7 +- .../web/src/theme/components/button.ts | 98 +++++++++++++++---- .../frontend/web/src/theme/components/tabs.ts | 23 +++-- 4 files changed, 101 insertions(+), 34 deletions(-) diff --git a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx index e62a7b34c3..39ec6fd245 100644 --- a/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx +++ b/invokeai/frontend/web/src/common/components/IAIMantineMultiSelect.tsx @@ -98,11 +98,12 @@ const IAIMantineMultiSelect = (props: IAIMultiSelectProps) => { }, }, '&[data-selected]': { - color: mode(base900, base50)(colorMode), - backgroundColor: mode(accent300, accent600)(colorMode), + backgroundColor: mode(accent400, accent600)(colorMode), + color: mode(base50, base100)(colorMode), fontWeight: 600, '&:hover': { - backgroundColor: mode(accent400, accent500)(colorMode), + backgroundColor: mode(accent500, accent500)(colorMode), + color: mode('white', base50)(colorMode), }, }, }, diff --git a/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx b/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx index 0ca4c2c04c..9b023fd2d7 100644 --- a/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx +++ b/invokeai/frontend/web/src/common/components/IAIMantineSelect.tsx @@ -101,11 +101,12 @@ const IAIMantineSelect = (props: IAISelectProps) => { }, }, '&[data-selected]': { - color: mode(base900, base50)(colorMode), - backgroundColor: mode(accent300, accent600)(colorMode), + backgroundColor: mode(accent400, accent600)(colorMode), + color: mode(base50, base100)(colorMode), fontWeight: 600, '&:hover': { - backgroundColor: mode(accent400, accent500)(colorMode), + backgroundColor: mode(accent500, accent500)(colorMode), + color: mode('white', base50)(colorMode), }, }, }, diff --git a/invokeai/frontend/web/src/theme/components/button.ts b/invokeai/frontend/web/src/theme/components/button.ts index 74560e4461..75662f7d42 100644 --- a/invokeai/frontend/web/src/theme/components/button.ts +++ b/invokeai/frontend/web/src/theme/components/button.ts @@ -4,52 +4,114 @@ import { mode } from '@chakra-ui/theme-tools'; const invokeAI = defineStyle((props) => { const { colorScheme: c } = props; // must specify `_disabled` colors if we override `_hover`, else hover on disabled has no styles + + if (c === 'base') { + const _disabled = { + bg: mode('base.200', 'base.700')(props), + color: mode('base.500', 'base.150')(props), + svg: { + fill: mode('base.500', 'base.150')(props), + }, + opacity: 1, + }; + + return { + bg: mode('base.200', 'base.600')(props), + color: mode('base.850', 'base.100')(props), + borderRadius: 'base', + textShadow: mode( + '0 0 0.3rem var(--invokeai-colors-base-50)', + '0 0 0.3rem var(--invokeai-colors-base-900)' + )(props), + svg: { + fill: mode('base.850', 'base.100')(props), + filter: mode( + 'drop-shadow(0px 0px 0.3rem var(--invokeai-colors-base-100))', + 'drop-shadow(0px 0px 0.3rem var(--invokeai-colors-base-800))' + )(props), + }, + _disabled, + _hover: { + bg: mode('base.300', 'base.500')(props), + color: mode('base.900', 'base.50')(props), + svg: { + fill: mode('base.900', 'base.50')(props), + }, + _disabled, + }, + _checked: { + bg: mode('accent.400', 'accent.600')(props), + color: mode('base.50', 'base.100')(props), + svg: { + fill: mode(`${c}.50`, `${c}.100`)(props), + filter: mode( + `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-600))`, + `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-800))` + )(props), + }, + _disabled, + _hover: { + bg: mode('accent.500', 'accent.500')(props), + color: mode('white', 'base.50')(props), + svg: { + fill: mode('white', 'base.50')(props), + }, + _disabled, + }, + }, + }; + } + const _disabled = { - bg: mode(`${c}.350`, `${c}.700`)(props), - color: mode(`${c}.750`, `${c}.150`)(props), + bg: mode(`${c}.200`, `${c}.700`)(props), + color: mode(`${c}.100`, `${c}.150`)(props), svg: { - fill: mode(`${c}.750`, `${c}.150`)(props), + fill: mode(`${c}.100`, `${c}.150`)(props), }, opacity: 1, - filter: 'saturate(65%)', + filter: mode(undefined, 'saturate(65%)')(props), }; return { - bg: mode(`${c}.200`, `${c}.600`)(props), - color: mode(`${c}.850`, `${c}.100`)(props), + bg: mode(`${c}.400`, `${c}.600`)(props), + color: mode(`base.50`, `base.100`)(props), borderRadius: 'base', textShadow: mode( - `0 0 0.3rem var(--invokeai-colors-${c}-50)`, + `0 0 0.3rem var(--invokeai-colors-${c}-600)`, `0 0 0.3rem var(--invokeai-colors-${c}-900)` )(props), svg: { - fill: mode(`${c}.850`, `${c}.100`)(props), + fill: mode(`base.50`, `base.100`)(props), filter: mode( - `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-100))`, + `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-600))`, `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-800))` )(props), }, _disabled, _hover: { - bg: mode(`${c}.300`, `${c}.500`)(props), - color: mode(`${c}.900`, `${c}.50`)(props), + bg: mode(`${c}.500`, `${c}.500`)(props), + color: mode('white', `base.50`)(props), svg: { - fill: mode(`${c}.900`, `${c}.50`)(props), + fill: mode('white', `base.50`)(props), }, _disabled, }, _checked: { - bg: mode('accent.200', 'accent.600')(props), - color: mode('accent.800', 'accent.100')(props), + bg: mode('accent.400', 'accent.600')(props), + color: mode('base.50', 'base.100')(props), svg: { - fill: mode('accent.800', 'accent.100')(props), + fill: mode(`base.50`, `base.100`)(props), + filter: mode( + `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-600))`, + `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-800))` + )(props), }, _disabled, _hover: { - bg: mode('accent.300', 'accent.500')(props), - color: mode('accent.900', 'accent.50')(props), + bg: mode('accent.500', 'accent.500')(props), + color: mode('white', 'base.50')(props), svg: { - fill: mode('accent.900', 'accent.50')(props), + fill: mode('white', 'base.50')(props), }, _disabled, }, diff --git a/invokeai/frontend/web/src/theme/components/tabs.ts b/invokeai/frontend/web/src/theme/components/tabs.ts index a0ab7dd3b9..adcce73bbc 100644 --- a/invokeai/frontend/web/src/theme/components/tabs.ts +++ b/invokeai/frontend/web/src/theme/components/tabs.ts @@ -37,20 +37,22 @@ const invokeAITablist = defineStyle((props) => { fill: mode('base.700', 'base.300')(props), }, _selected: { - borderBottomColor: 'base.800', - bg: mode('accent.200', 'accent.600')(props), - color: mode('accent.800', 'accent.100')(props), - _hover: { - bg: mode('accent.300', 'accent.500')(props), - color: mode('accent.900', 'accent.50')(props), - }, + bg: mode('accent.400', 'accent.600')(props), + color: mode('base.50', 'base.100')(props), svg: { - fill: mode('base.900', 'base.50')(props), + fill: mode(`base.50`, `base.100`)(props), filter: mode( - `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-accent-100))`, - `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-accent-900))` + `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-600))`, + `drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${c}-800))` )(props), }, + _hover: { + bg: mode('accent.500', 'accent.500')(props), + color: mode('white', 'base.50')(props), + svg: { + fill: mode('white', 'base.50')(props), + }, + }, }, _hover: { bg: mode('base.100', 'base.800')(props), @@ -81,5 +83,6 @@ export const tabsTheme = defineMultiStyleConfig({ }, defaultProps: { variant: 'invokeAI', + colorScheme: 'accent', }, });