using more of mui colors
This commit is contained in:
1 parent
d50674c8fe
commit
905a5ac4d7
21 files changed
+150
-132
No files matched your search
@@ -2,25 +2,9 @@
|
||||
@import url(https://fonts.googleapis.com/icon?family=Material+Icons);
|
||||
|
||||
:root {
|
||||
--primary: #111;
|
||||
--primary-light: #333;
|
||||
--primary-light-opaque: #3335;
|
||||
--secondary-opaque: #1c1c1c;
|
||||
--secondary: #1c1c1c;
|
||||
--primary-accent: #bbb;
|
||||
--primary-accent-light: #eee;
|
||||
--secondary-accent: #929191;
|
||||
--green: #1f1;
|
||||
--green-opaque: #1f15;
|
||||
--green-light: #6f5;
|
||||
--error: #c55;
|
||||
--error-light: #f77;
|
||||
--error-dark: #5c2323;
|
||||
--error-opaque: #c555;
|
||||
--error-accent: #9f3a3a;
|
||||
--change: #0f9;
|
||||
--condition-primary: #447;
|
||||
--condition-accent: #8af;
|
||||
--condition-primary-opaque: #4476;
|
||||
touch-action: pan-x pan-y;
|
||||
height: 100%;
|
||||
@@ -48,17 +32,17 @@ body,
|
||||
|
||||
/* Track */
|
||||
::-webkit-scrollbar-track {
|
||||
background: var(--secondary);
|
||||
background: var(--mui-secondary-contrastText);
|
||||
}
|
||||
|
||||
/* Handle */
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: var(--secondary-accent);
|
||||
background: var(--mui-grey-700);
|
||||
}
|
||||
|
||||
/* Handle on hover */
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: var(--primary-accent);
|
||||
background: var(--mui-grey-400);
|
||||
}
|
||||
|
||||
* {
|
||||
|
||||
+51
-39
@@ -1,49 +1,61 @@
|
||||
import "styles/root.css";
|
||||
|
||||
import { Classes } from "jss";
|
||||
import { Context, createContext } from "react"
|
||||
import { Context, createContext } from "react";
|
||||
import { createUseStyles, Styles } from "react-jss";
|
||||
import { createTheming } from "theming"
|
||||
import { createTheming } from "theming";
|
||||
|
||||
export const {
|
||||
context: ThemeContext,
|
||||
ThemeProvider,
|
||||
useTheme,
|
||||
} = createTheming(createContext({
|
||||
primary: 'var(--primary)',
|
||||
primaryLight: 'var(--primary-light)',
|
||||
primaryLightOpaque: 'var(--primary-light-opaque)',
|
||||
secondary: 'var(--secondary)',
|
||||
secondaryOpaque: 'var(--secondary-opaque)',
|
||||
primaryAccent: 'var(--primary-accent)',
|
||||
primaryAccentLight: 'var(--primary-accent-light)',
|
||||
secondaryAccent: 'var(--secondary-accent)',
|
||||
context: ThemeContext,
|
||||
ThemeProvider,
|
||||
useTheme,
|
||||
} = createTheming(
|
||||
createContext({
|
||||
primary: "var(--mui-common-black)",
|
||||
primaryLight: "var(--mui-grey-600)",
|
||||
primaryLightOpaque: "var(--primary-light-opaque)",
|
||||
secondary: "var(--mui-secondary-contrastText)",
|
||||
secondaryOpaque: "var(--mui-secondary-contrastText)",
|
||||
primaryAccent: "var(--mui-grey-400)",
|
||||
primaryAccentLight: "var(--mui-grey-200)",
|
||||
secondaryAccent: "var(--mui-grey-700)",
|
||||
condition: {
|
||||
primaryColor: 'var(--condition-primary)',
|
||||
primaryAccent: 'var(--condition-accent)',
|
||||
primaryColorOpaque: 'var(--condition-primary-opaque)'
|
||||
primaryColor: "var(--mui-info-dark)",
|
||||
primaryAccent: "var(--mui-info-light)",
|
||||
primaryColorOpaque: "var(--condition-primary-opaque)",
|
||||
},
|
||||
green: 'var(--green)',
|
||||
greenLight: 'var(--green-light)',
|
||||
greenOpaque: 'var(--green-opaque)',
|
||||
red: 'var(--error)',
|
||||
redOpaque: 'var(--error-opaque)',
|
||||
redAccent: 'var(--error-accent)',
|
||||
redLight: 'var(--error-light)',
|
||||
}));
|
||||
green: "var(--mui-success-main)",
|
||||
greenLight: "var(--mui-success-light)",
|
||||
greenOpaque: "var(--green-opaque)",
|
||||
red: "var(--mui-error-main)",
|
||||
redOpaque: "var(--error-opaque)",
|
||||
redAccent: "var(--mui-error-contrastText)",
|
||||
redLight: "var(--mui-error-light)",
|
||||
})
|
||||
);
|
||||
|
||||
export type GetThemeType<C extends Context<any>> = C extends Context<infer T> ? T : unknown;
|
||||
export type ClassNamesOfStyle<F extends (...args: any) => any> = Record<keyof ReturnType<F>, string>;
|
||||
export type GetThemeType<C extends Context<any>> = C extends Context<infer T>
|
||||
? T
|
||||
: unknown;
|
||||
export type ClassNamesOfStyle<F extends (...args: any) => any> = Record<
|
||||
keyof ReturnType<F>,
|
||||
string
|
||||
>;
|
||||
export type AppTheme = GetThemeType<typeof ThemeContext>;
|
||||
export const createAppUseStyles = <
|
||||
Props extends {} = {},
|
||||
C extends string = string,
|
||||
>(f: (theme: AppTheme) => Styles<C, Props, AppTheme>) => (props: Props): {
|
||||
classes: Classes<keyof Styles<C, Props, AppTheme>>,
|
||||
theme: AppTheme,
|
||||
} => {
|
||||
const theme = useTheme();
|
||||
const useStyles = createUseStyles<C, Props, AppTheme>(f as any)
|
||||
const classes = useStyles({ ...props, theme }) as Classes<keyof Styles<C, Props, AppTheme>>;
|
||||
return { classes, theme };
|
||||
}
|
||||
export const createAppUseStyles =
|
||||
<Props extends {} = {}, C extends string = string>(
|
||||
f: (theme: AppTheme) => Styles<C, Props, AppTheme>
|
||||
) =>
|
||||
(
|
||||
props: Props
|
||||
): {
|
||||
classes: Classes<keyof Styles<C, Props, AppTheme>>;
|
||||
theme: AppTheme;
|
||||
} => {
|
||||
const theme = useTheme();
|
||||
const useStyles = createUseStyles<C, Props, AppTheme>(f as any);
|
||||
const classes = useStyles({ ...props, theme }) as Classes<
|
||||
keyof Styles<C, Props, AppTheme>
|
||||
>;
|
||||
return { classes, theme };
|
||||
};
|
||||
Reference in new issue
Block a user