@@ -16,6 +16,7 @@ import {
1616import { css , cx } from '@leafygreen-ui/emotion' ;
1717import { isEqual } from 'lodash' ;
1818import { rafraf } from '../utils/rafraf' ;
19+ import { BaseFontSize , fontWeights } from '@leafygreen-ui/tokens' ;
1920
2021type ToolbarData = Required < DrawerLayoutProps > [ 'toolbarData' ] ;
2122
@@ -175,6 +176,14 @@ const drawerLayoutFixesStyles = css({
175176 borderTop : 'none' ,
176177 borderBottom : 'none' ,
177178 } ,
179+
180+ // drawer content > title content
181+ '& > div:nth-child(2) > div:nth-child(2) > div:first-child > div:first-child > div:first-child > div:first-child' :
182+ {
183+ // fix for the flex parent not allowing flex children to collapse if they
184+ // are overflowing the container
185+ minWidth : 0 ,
186+ } ,
178187} ) ;
179188
180189const emptyDrawerLayoutFixesStyles = css ( {
@@ -205,6 +214,16 @@ const drawerSectionPortalStyles = css({
205214 height : '100%' ,
206215} ) ;
207216
217+ // Leafygreen dynamically changes styles of the title group based on whether or
218+ // not title is a `string` or a `ReactNode`, we want it to consistently have
219+ // bold title styles no matter what title you provided, so we wrap it in our own
220+ // container
221+ const drawerTitleGroupStyles = css ( {
222+ width : '100%' ,
223+ fontSize : BaseFontSize . Body2 ,
224+ fontWeight : fontWeights . bold ,
225+ } ) ;
226+
208227/**
209228 * DrawerAnchor component will render the drawer in any place it is rendered.
210229 * This component has to wrap any content that Drawer will be shown near
@@ -235,6 +254,7 @@ export const DrawerAnchor: React.FunctionComponent<{
235254 . map ( ( data ) => {
236255 return {
237256 ...data ,
257+ title : < div className = { drawerTitleGroupStyles } > { data . title } </ div > ,
238258 content : (
239259 < div
240260 key = { data . id }
0 commit comments