Skip to content

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

Set transition time from variables

Krzysztof Bialoglowicz56331794c184
diff --git a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
index 0db6bbf35e..6243a4d520 100644
--- a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
@@ -102,7 +102,7 @@ const styles = (theme: Theme) =>
position: "absolute",
right: -16,
top: 65,
- transition: "background 0.2s",
+ transition: `background ${theme.transitions.duration.short}s`,
width: 32,
zIndex: 99
},
@@ -112,7 +112,7 @@ const styles = (theme: Theme) =>
"linear-gradient(0deg, rgba(25, 195, 190, 0.1), rgba(25, 195, 190, 0.1)), #2E2F31"
},
border: `solid 1px #252728`,
- transition: "background 0.2s"
+ transition: `background ${theme.transitions.duration.short}s`
},
isMenuSmallHide: {
"& svg": {
@@ -176,7 +176,7 @@ const styles = (theme: Theme) =>
marginRight: theme.spacing.unit * 2,
position: "relative",
transform: "rotate(0deg)",
- transition: ".2s ease-in-out",
+ transition: `${theme.transitions.duration.short}s ease-in-out`,
width: 42
},
menuIconDark: {
diff --git a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
index 45b33bdd57..d6f824f845 100644
--- a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
@@ -110,12 +110,12 @@ const styles = (theme: Theme) =>
opacity: 1,
paddingLeft: 16,
textTransform: "uppercase",
- transition: "opacity 0.2s ease 0.1s"
+ transition: `opacity ${theme.transitions.duration.short}s ease 0.1s`
},
menuListItemTextHide: {
opacity: 0,
position: "absolute",
- transition: "opacity 0.2s ease"
+ transition: `opacity ${theme.transitions.duration.short}s ease`
},
subMenu: {
padding: "0 15px"
diff --git a/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx b/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx
index 1911ddd2de..a3d1a5c6d7 100644
--- a/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/MenuNested.tsx
@@ -34,7 +34,7 @@ const styles = (theme: Theme) =>
position: "absolute",
right: 0,
top: 0,
- transition: "right 0.2s ease",
+ transition: `right ${theme.transitions.duration.short}s ease`,
width: 300,
zIndex: -1
},
diff --git a/saleor/static/dashboard-next/theme.ts b/saleor/static/dashboard-next/theme.ts
index 3826ae4471..c9e474bc2c 100644
--- a/saleor/static/dashboard-next/theme.ts
+++ b/saleor/static/dashboard-next/theme.ts
@@ -328,6 +328,11 @@ export default (colors: IThemeColors): Theme =>
createShadow(9, 44, 7, 11, 16, -6, 22, 35, 2),
createShadow(9, 46, 8, 11, 15, -7, 24, 38, 3)
],
+ transitions: {
+ duration: {
+ short: 0.2
+ }
+ },
typography: {
allVariants: {
fontFamily