55 * found at http://www.apache.org/licenses/LICENSE-2.0.
66 */
77
8- import styled , { ThemeProps , DefaultTheme } from 'styled-components' ;
9- import { getColorV8 , retrieveComponentStyles , DEFAULT_THEME } from '@zendeskgarden/react-theming' ;
8+ import styled , { ThemeProps , DefaultTheme , css } from 'styled-components' ;
9+ import { getColor , retrieveComponentStyles , DEFAULT_THEME } from '@zendeskgarden/react-theming' ;
1010
1111const COMPONENT_ID = 'modals.drawer_modal' ;
1212
1313const DRAWER_WIDTH = 380 ;
1414
15- const boxShadow = ( props : ThemeProps < DefaultTheme > ) => {
16- const { theme } = props ;
17- const { space, shadows } = theme ;
18- const offsetY = `${ space . base * 5 } px` ;
19- const blurRadius = `${ space . base * 7 } px` ;
20- const color = getColorV8 ( 'neutralHue' , 800 , theme , 0.35 ) ;
15+ const colorStyles = ( { theme } : ThemeProps < DefaultTheme > ) => {
16+ const offsetY = `${ theme . space . base * 5 } px` ;
17+ const blurRadius = `${ theme . space . base * 7 } px` ;
18+ const shadowColor = getColor ( {
19+ theme,
20+ hue : 'neutralHue' ,
21+ shade : 1200 ,
22+ light : { transparency : theme . opacity [ 200 ] } ,
23+ dark : { transparency : theme . opacity [ 1000 ] }
24+ } ) ;
25+ const shadow = theme . shadows . lg ( offsetY , blurRadius , shadowColor ) ;
2126
22- return shadows . lg ( offsetY , blurRadius , color as string ) ;
27+ const borderColor = getColor ( { theme, variable : 'border.default' } ) ;
28+ const backgroundColor = getColor ( { theme, variable : 'background.raised' } ) ;
29+
30+ return css `
31+ border-color : ${ borderColor } ;
32+ box-shadow : ${ shadow } ;
33+ background-color : ${ backgroundColor } ;
34+ ` ;
2335} ;
2436
2537/**
@@ -35,8 +47,8 @@ export const StyledDrawer = styled.div.attrs({
3547 ${ props => ( props . theme . rtl ? 'left' : 'right' ) } : 0;
3648 flex-direction: column;
3749 z-index: 500;
38- box-shadow: ${ boxShadow } ;
39- background: ${ props => getColorV8 ( 'background' , 600 /* default shade */ , props . theme ) } ;
50+ ${ props => ( props . theme . rtl ? 'border-right' : 'border-left' ) } : ${ props =>
51+ props . theme . borders . sm } ;
4052 width: ${ DRAWER_WIDTH } px;
4153 height: 100%;
4254 overflow: auto;
@@ -62,6 +74,8 @@ export const StyledDrawer = styled.div.attrs({
6274 outline: none;
6375 }
6476
77+ ${ colorStyles }
78+
6579 ${ props => retrieveComponentStyles ( COMPONENT_ID , props ) } ;
6680` ;
6781
0 commit comments