From a011a77ef6c70a66f651d644fb7395369c377a6c Mon Sep 17 00:00:00 2001 From: Wes Souza Date: Tue, 19 Jul 2022 09:25:12 -0400 Subject: [PATCH] feat(themes): only add shadow by default if theme also specifies it as default --- src/Cutout/Cutout.js | 3 ++- src/common/index.js | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Cutout/Cutout.js b/src/Cutout/Cutout.js index eaa18b87..c0585c29 100644 --- a/src/Cutout/Cutout.js +++ b/src/Cutout/Cutout.js @@ -31,7 +31,8 @@ export const StyledCutout = styled.div` border-bottom-color: ${({ theme }) => theme.borderLight}; pointer-events: none; - ${props => props.shadow && `box-shadow:${insetShadow};`} + ${props => + props.theme.shadow && props.shadow && `box-shadow:${insetShadow};`} } `; diff --git a/src/common/index.js b/src/common/index.js index e6d9c22d..ff0a49d7 100644 --- a/src/common/index.js +++ b/src/common/index.js @@ -64,8 +64,9 @@ export const createBorderStyles = ({ border-top-color: ${({ theme }) => theme.borderDarkest}; border-right-color: ${({ theme }) => theme.borderLightest}; border-bottom-color: ${({ theme }) => theme.borderLightest}; - box-shadow: ${props => props.shadow && `${shadow}, `} inset 1px 1px 0px - 1px ${({ theme }) => theme.borderDark}, + box-shadow: ${props => + props.theme.shadow && props.shadow && `${shadow}, `} + inset 1px 1px 0px 1px ${({ theme }) => theme.borderDark}, inset -1px -1px 0 1px ${({ theme }) => theme.borderLight}; ` : css` @@ -77,8 +78,9 @@ export const createBorderStyles = ({ windowBorders ? theme.borderLight : theme.borderLightest}; border-right-color: ${({ theme }) => theme.borderDarkest}; border-bottom-color: ${({ theme }) => theme.borderDarkest}; - box-shadow: ${props => props.shadow && `${shadow}, `} inset 1px 1px 0px - 1px + box-shadow: ${props => + props.theme.shadow && props.shadow && `${shadow}, `} + inset 1px 1px 0px 1px ${({ theme }) => windowBorders ? theme.borderLightest : theme.borderLight}, inset -1px -1px 0 1px ${({ theme }) => theme.borderDark};