feat(ui): remove themes, add hand-crafted dark and light modes

Themes are very fun but due to the differences in perceived saturation and lightness across the
the color spectrum, it's impossible to have have multiple themes that look great without hand-
crafting *every* shade for *every* theme. We've ended up with 4 OK themes (well, 3, because the
light theme was pretty bad).

I've removed the themes and added color mode support. There is now a single dark and light mode,
each with their own color palette and the classic grey / purple / yellow invoke colors that
@blessedcoolant first designed.

I've re-styled almost everything except the model manager and lightbox, which I keep forgetting
to work on.

One new concept is the Chakra `layerStyle`. This lets us define "layers" - think body, first layer,
second layer, etc - that can be applied on various components. By defining layers, we can be more
consistent about the z-axis and its relationship to color and lightness.
This commit is contained in:
psychedelicious
2023-06-27 00:12:33 +10:00
parent 28d78a8fb4
commit 032c7e68d0
62 changed files with 839 additions and 516 deletions

View File

@ -1,6 +1,6 @@
// Grid drawing adapted from https://longviewcoder.com/2021/12/08/konva-a-better-grid/
import { useToken } from '@chakra-ui/react';
import { useColorMode, useColorModeValue, useToken } from '@chakra-ui/react';
import { createSelector } from '@reduxjs/toolkit';
import { RootState } from 'app/store/store';
import { useAppSelector } from 'app/store/storeHooks';
@ -29,9 +29,12 @@ const IAICanvasGrid = () => {
);
const { stageScale, stageCoordinates, stageDimensions } =
useAppSelector(selector);
const { colorMode } = useColorMode();
const [gridLines, setGridLines] = useState<ReactNode[]>([]);
const [gridLineColor] = useToken('colors', ['gridLineColor']);
const [darkGridLineColor, lightGridLineColor] = useToken('colors', [
'base.800',
'base.200',
]);
const unscale = useCallback(
(value: number) => {
@ -89,7 +92,7 @@ const IAICanvasGrid = () => {
x={fullRect.x1 + i * 64}
y={fullRect.y1}
points={[0, 0, 0, ySize]}
stroke={gridLineColor}
stroke={colorMode === 'dark' ? darkGridLineColor : lightGridLineColor}
strokeWidth={1}
/>
));
@ -99,7 +102,7 @@ const IAICanvasGrid = () => {
x={fullRect.x1}
y={fullRect.y1 + i * 64}
points={[0, 0, xSize, 0]}
stroke={gridLineColor}
stroke={colorMode === 'dark' ? darkGridLineColor : lightGridLineColor}
strokeWidth={1}
/>
));
@ -111,7 +114,9 @@ const IAICanvasGrid = () => {
stageDimensions,
currentTheme,
unscale,
gridLineColor,
colorMode,
darkGridLineColor,
lightGridLineColor,
]);
return <Group>{gridLines}</Group>;

View File

@ -104,7 +104,10 @@ const IAICanvasStatusText = () => {
margin: 1,
borderRadius: 'base',
pointerEvents: 'none',
bg: 'base.800',
bg: 'base.200',
_dark: {
bg: 'base.800',
},
}}
>
<Box