diff --git a/components/frontend/src/App.css b/components/frontend/src/App.css index 610c057fed..20fbbcd8aa 100644 --- a/components/frontend/src/App.css +++ b/components/frontend/src/App.css @@ -1,21 +1,3 @@ -.MainContainer { - flex: 1; - margin-top: 6em; - padding-left: 1em; - padding-right: 1em; -} - -@media print { - .MainContainer { - margin-top: 0em; - } -} - html { scroll-padding-top: 163px; /* height of sticky header */ } - -:root { - --inverted-menu-background-color: #1b1c1d; - --selection-color: #2185d0; -} diff --git a/components/frontend/src/App.js b/components/frontend/src/App.js index 6ee06731d5..1a8673c914 100644 --- a/components/frontend/src/App.js +++ b/components/frontend/src/App.js @@ -1,6 +1,7 @@ import "./App.css" -import { createTheme, ThemeProvider } from "@mui/material/styles" +import { grey, orange } from "@mui/material/colors" +import { createTheme, responsiveFontSizes, ThemeProvider } from "@mui/material/styles" import { Action } from "history" import history from "history/browser" import { Component } from "react" @@ -14,13 +15,57 @@ import { registeredURLSearchParams } from "./hooks/url_search_query" import { isValidDate_YYYYMMDD, toISODateStringInCurrentTZ } from "./utils" import { showConnectionMessage, showMessage } from "./widgets/toast" -const theme = createTheme({ +let theme = createTheme({ colorSchemes: { dark: true, // Add a dark theme (light theme is available by default) }, - components: { MuiTooltip: { defaultProps: { arrow: true }, styleOverrides: { tooltip: { fontSize: "1em" } } } }, + components: { + MuiTooltip: { + defaultProps: { arrow: true }, + styleOverrides: { tooltip: { fontSize: "1em" } }, + }, + }, +}) + +theme = createTheme(theme, { + palette: { + todo: theme.palette.augmentColor({ color: { main: grey[600] }, name: "todo" }), + doing: theme.palette.augmentColor({ color: { main: theme.palette.info.main }, name: "doing" }), + done: theme.palette.augmentColor({ color: { main: theme.palette.success.main }, name: "done" }), + target_not_met: theme.palette.augmentColor({ + color: { main: theme.palette.error.main }, + name: "target_not_met", + }), + target_met: theme.palette.augmentColor({ color: { main: theme.palette.success.main }, name: "target_met" }), + near_target_met: theme.palette.augmentColor({ color: { main: orange[300] }, name: "near_target_met" }), + debt_target_met: theme.palette.augmentColor({ color: { main: grey[500] }, name: "debt_target_met" }), + informative: theme.palette.augmentColor({ color: { main: theme.palette.info.main }, name: "informative" }), + unknown: theme.palette.augmentColor({ color: { main: grey[300] }, name: "unknown" }), + total: theme.palette.augmentColor({ color: { main: grey[800] }, name: "total" }), + }, + typography: { + h1: { + fontSize: theme.typography.h4.fontSize, + fontWeight: 700, + }, + h2: { + fontSize: theme.typography.h5.fontSize, + fontWeight: 600, + }, + h3: { + fontSize: theme.typography.h6.fontSize, + }, + h4: { + fontSize: theme.typography.subtitle1.fontSize, + }, + h5: { + fontSize: theme.typography.subtitle2.fontSize, + }, + }, }) +theme = responsiveFontSizes(theme) + class App extends Component { constructor(props) { super(props) diff --git a/components/frontend/src/AppUI.js b/components/frontend/src/AppUI.js index 4b35645ba8..7494a249df 100644 --- a/components/frontend/src/AppUI.js +++ b/components/frontend/src/AppUI.js @@ -66,65 +66,55 @@ export function AppUI({ } const darkMode = userPrefersDarkMode(mode) - const backgroundColor = darkMode ? "rgb(40, 40, 40)" : "white" return ( -
- - - - - } - settings={settings} - setUIMode={setMode} - uiMode={mode} - /> - - - - - - -
+ + + + + } + settings={settings} + setUIMode={setMode} + uiMode={mode} + /> + + + + + + +