bitburner-src/src/ui/React/Theme.tsx

125 lines
2.4 KiB
TypeScript
Raw Normal View History

2021-09-13 18:44:46 +02:00
import React from "react";
2021-09-14 04:27:43 +02:00
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
2021-09-13 18:44:46 +02:00
export const colors = {
2021-09-13 23:11:02 +02:00
primarylight: "#0f0",
primary: "#0c0",
2021-09-13 18:44:46 +02:00
primarydark: "#090",
2021-09-13 23:11:02 +02:00
well: "#222",
2021-09-13 18:44:46 +02:00
};
export const theme = createMuiTheme({
palette: {
primary: {
main: colors.primary,
dark: colors.primarydark,
},
},
typography: {
button: {
textTransform: "none",
},
},
2021-09-13 23:11:02 +02:00
overrides: {
MuiInputBase: {
root: {
backgroundColor: colors.well,
},
2021-09-14 02:37:35 +02:00
input: {
color: colors.primary,
"&::placeholder": {
userSelect: "none",
color: colors.primarydark,
},
},
},
MuiInput: {
root: {
backgroundColor: colors.well,
borderBottomColor: "#fff",
},
underline: {
2021-09-14 04:27:43 +02:00
"&:hover": {
2021-09-14 02:37:35 +02:00
borderBottomColor: colors.primarydark,
},
"&:before": {
borderBottomColor: colors.primary,
},
"&:after": {
borderBottomColor: colors.primarylight,
},
},
},
MuiInputLabel: {
root: {
color: colors.primarydark, // why is this switched?
userSelect: "none",
"&:before": {
color: colors.primarylight,
},
},
},
2021-09-14 04:27:43 +02:00
MuiButton: {
root: {
backgroundColor: "#333",
border: "1px solid " + colors.well,
color: colors.primary,
margin: "5px",
padding: "3px 5px",
"&:hover": {
backgroundColor: "#000",
},
borderRadius: 0,
},
},
2021-09-14 02:37:35 +02:00
MuiSelect: {
icon: {
color: colors.primary,
},
},
MuiMenu: {
list: {
backgroundColor: colors.well,
},
},
MuiMenuItem: {
root: {
color: colors.primary,
},
},
MuiAccordionSummary: {
root: {
backgroundColor: "#111",
},
},
MuiAccordionDetails: {
root: {
backgroundColor: "#000",
},
2021-09-13 23:11:02 +02:00
},
2021-09-14 04:27:43 +02:00
MuiIconButton: {
root: {
color: colors.primary,
},
},
MuiTooltip: {
tooltip: {
fontSize: "1em",
color: colors.primary,
backgroundColor: colors.well,
borderRadius: 0,
border: "2px solid white",
},
},
2021-09-13 23:11:02 +02:00
},
2021-09-13 18:44:46 +02:00
});
interface IProps {
children: JSX.Element[] | JSX.Element;
}
export const Theme = ({ children }: IProps): React.ReactElement => (
<ThemeProvider theme={theme}>{children}</ThemeProvider>
);