Add themes

This commit is contained in:
jeffvli
2022-04-21 19:30:27 -07:00
parent ec7faeb997
commit f7b580f02f
4 changed files with 80 additions and 31 deletions

View File

@@ -1,38 +1,19 @@
import { Global, MantineProvider } from '@mantine/core';
import './App.css';
import { useEffect, useState } from 'react';
import { MantineProvider } from '@mantine/core';
import Router from './Router';
import { dark } from './themes';
import base from './themes/base';
import './App.css';
export default function App() {
return (
<MantineProvider
theme={{
colorScheme: 'dark',
focusRing: 'auto',
spacing: {
xs: 2,
sm: 5,
},
other: {
background: '#141518',
sidebar: '#101010',
playerbar: '#101010',
},
}}
>
<Global
styles={(theme) => {
return {
'*, *::before, *::after': {
boxSizing: 'border-box',
},
const [theme, setTheme] = useState<any>(base);
body: {
backgroundColor: theme.other.background,
color: theme.colors.dark[0],
},
};
}}
/>
useEffect(() => {
setTheme(dark);
}, []);
return (
<MantineProvider theme={theme}>
<Router />
</MantineProvider>
);

View File

@@ -0,0 +1,35 @@
const base = {
focusRing: 'auto',
spacing: {
xs: 2,
sm: 5,
},
colors: {
layout: [
'#181819',
'#101010',
'#101010',
'#000000',
'#000000',
'#000000',
'#000000',
'#000000',
'#000000',
'#000000',
],
primary: [
'#ddf6ff',
'#b0deff',
'#82c6fb',
'#53aff7',
'#2598f3',
'#0c7fda',
'#0062aa',
'#00467b',
'#002a4d',
'#000f1f',
],
},
};
export default base;

View File

@@ -0,0 +1,32 @@
import base from './base';
export const dark = {
...base,
colorScheme: 'dark',
colors: {
layout: [
'#181819',
'#101010',
'#101010',
'#000000',
'#000000',
'#000000',
'#000000',
'#000000',
'#000000',
'#000000',
],
primary: [
'#ddf6ff',
'#b0deff',
'#82c6fb',
'#53aff7',
'#2598f3',
'#0c7fda',
'#0062aa',
'#00467b',
'#002a4d',
'#000f1f',
],
},
};

View File

@@ -0,0 +1 @@
export * from './dark';