@@ -4,9 +4,24 @@ import Styled from 'rsg-components/Styled'
44import cx from 'classnames'
55import Logo from 'rsg-components/Logo'
66import Markdown from 'rsg-components/Markdown'
7+ import { createGlobalStyle } from 'styled-components'
78
9+ import CSSReset from '@tds/core-css-reset'
810import FlexGrid from '@tds/core-flex-grid'
911
12+ const GlobalStyleGuide = createGlobalStyle ( {
13+ // Full width container with limited with parent: https://css-tricks.com/full-width-containers-limited-width-parents/
14+ // Only activate with there is no sidebar
15+ '.rsg--root-1:not(*[class*=\'rsg--hasSidebar\']) .docs_full-width-playground' : {
16+ width : '100vw' ,
17+ position : 'relative' ,
18+ left : '50%' ,
19+ right : '50%' ,
20+ marginLeft : '-50vw' ,
21+ marginRight : '-50vw' ,
22+ }
23+ } )
24+
1025const styles = ( { color, fontFamily, fontSize, sidebarWidth, mq, space, maxWidth } ) => ( {
1126 root : {
1227 backgroundColor : color . baseBackground ,
@@ -77,20 +92,23 @@ export function StyleGuideRenderer({ classes, title, homepageUrl, children, toc,
7792 )
7893
7994 return (
80- < div className = { cx ( classes . root , hasSidebar && classes . hasSidebar ) } >
81- < a id = "styleguidist-top" > </ a >
95+ < >
96+ < CSSReset />
97+ < div className = { cx ( classes . root , hasSidebar && classes . hasSidebar ) } >
98+ < a id = "styleguidist-top" > </ a >
8299
83- { hasSidebar ? main : < TdsGrid > { main } </ TdsGrid > }
100+ { hasSidebar ? main : < TdsGrid > { main } </ TdsGrid > }
84101
85- { hasSidebar && (
86- < div className = { classes . sidebar } >
87- < div className = { classes . logo } >
88- < Logo > { title } </ Logo >
102+ { hasSidebar && (
103+ < div className = { classes . sidebar } >
104+ < div className = { classes . logo } >
105+ < Logo > { title } </ Logo >
106+ </ div >
107+ { toc }
89108 </ div >
90- { toc }
91- </ div >
92- ) }
93- </ div >
109+ ) }
110+ </ div >
111+ </ >
94112 )
95113}
96114
0 commit comments