Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add dark styles

Krzysztof Bialoglowicz6bcceff4a7b2
diff --git a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
index 1fadef4d07..3dc74d0e86 100644
--- a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
@@ -52,12 +52,18 @@ const styles = (theme: Theme) =>
transition: theme.transitions.duration.standard + "ms"
},
content: {
+ [theme.breakpoints.down("md")]: {
+ paddingLeft: 0
+ },
paddingLeft: drawerWidth,
position: "absolute",
transition: "padding-left 0.5s ease",
width: "100%"
},
contentToggle: {
+ [theme.breakpoints.down("md")]: {
+ paddingLeft: 0
+ },
paddingLeft: drawerWidthSmall
},
darkThemeSwitch: {
@@ -77,17 +83,25 @@ const styles = (theme: Theme) =>
height: "100%",
margin: "20px 50px"
},
- background: "#21125E",
+ background: theme.palette.secondary.main,
display: "block",
height: 80
},
+ logoDark: {
+ "& path": {
+ fill: theme.palette.common.white
+ },
+ background: theme.palette.primary.main
+ },
logoSmall: {
"& svg": {
margin: "0px 25px"
}
},
menu: {
- background: "#fff",
+ background: theme.palette.background.paper,
+ boxShadow: "0px 0px 12px 1px rgba(0,0,0,0.2)",
+ height: "100vh",
padding: 25
},
menuIcon: {
@@ -149,10 +163,15 @@ const styles = (theme: Theme) =>
zIndex: 1999
},
menuSmall: {
- background: "#fff",
+ background: theme.palette.background.paper,
+ boxShadow: "0px 0px 12px 1px rgba(0,0,0,0.2)",
+ height: "100vh",
padding: "0 25px"
},
menuToggle: {
+ "& path": {
+ fill: theme.palette.primary.main
+ },
"& span": {
margin: "0 8px"
},
@@ -160,7 +179,7 @@ const styles = (theme: Theme) =>
marginTop: 12,
transform: "rotate(180deg)"
},
- background: "#fff",
+ background: theme.palette.background.paper,
borderRadius: "50%",
cursor: "pointer",
height: 32,
@@ -284,7 +303,8 @@ const AppLayout = withStyles(styles, {
>
<div
className={classNames(classes.logo, {
- [classes.logoSmall]: menuToggle
+ [classes.logoSmall]: menuToggle,
+ [classes.logoDark]: isDark
})}
>
<SVG
diff --git a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
index 2cc9a36715..3ad3a08b97 100644
--- a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
@@ -10,6 +10,7 @@ import React from "react";
import SVG from "react-inlinesvg";
import { matchPath } from "react-router";
+import useTheme from "@saleor/hooks/useTheme";
import { User } from "../../auth/types/User";
import { configurationMenu, configurationMenuUrl } from "../../configuration";
import i18n from "../../i18n";
@@ -32,6 +33,11 @@ const styles = (theme: Theme) =>
position: "relative",
top: 8
},
+ menuIconDark: {
+ "& path": {
+ fill: theme.palette.common.white
+ }
+ },
menuList: {
display: "flex",
flexDirection: "column",
@@ -99,7 +105,7 @@ const styles = (theme: Theme) =>
"& $menuListItemText": {
textTransform: "none"
},
- background: "#fff",
+ background: theme.palette.background.paper,
height: "100vh",
position: "absolute",
right: 0,
@@ -183,6 +189,7 @@ const MenuList = withStyles(styles, { name: "MenuList" })(
renderConfigure,
onMenuItemClick
}: MenuListProps & WithStyles<typeof styles>) => {
+ const { isDark } = useTheme();
const [activeSubMenu, setActiveSubMenu] = React.useState<IActiveSubMenu>({
isActive: false,
label: ""
@@ -244,7 +251,12 @@ const MenuList = withStyles(styles, { name: "MenuList" })(
})}
>
<div onClick={() => handleSubMenu(menuItem.ariaLabel)}>
- <SVG className={classes.menuIcon} src={menuItem.icon} />
+ <SVG
+ className={classNames(classes.menuIcon, {
+ [classes.menuIconDark]: isDark
+ })}
+ src={menuItem.icon}
+ />
{menuToggle && (
<Typography
aria-label={menuItem.ariaLabel}
@@ -285,7 +297,12 @@ const MenuList = withStyles(styles, { name: "MenuList" })(
onClick={event => closeSubMenu(menuItem.url, event)}
key={menuItem.label}
>
- <SVG className={classes.menuIcon} src={menuItem.icon} />
+ <SVG
+ className={classNames(classes.menuIcon, {
+ [classes.menuIconDark]: isDark
+ })}
+ src={menuItem.icon}
+ />
{menuToggle && (
<Typography
aria-label={menuItem.ariaLabel}
@@ -310,7 +327,12 @@ const MenuList = withStyles(styles, { name: "MenuList" })(
href={createHref(configurationMenuUrl)}
onClick={event => onMenuItemClick(configurationMenuUrl, event)}
>
- <SVG className={classes.menuIcon} src={configureIcon} />
+ <SVG
+ className={classNames(classes.menuIcon, {
+ [classes.menuIconDark]: isDark
+ })}
+ src={configureIcon}
+ />
{menuToggle && (
<Typography
aria-label="configure"