From a4b4dce1017e487e580b4056e50c92aa55e9e66e Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Wed, 11 Sep 2019 11:13:10 +1000 Subject: [PATCH] Move remaining body styles to `bodyStyles` This isn't a complete fix for #54, but it is a step forward, as it allows users to safely do: ```js import { createGlobalStyle } from 'styled-components'; import { global } from '@storybook/design-system'; const CustomGlobalStyle = createGlobalStyle` body { ${global.bodyStyles} } }` ``` In their own code to avoid the `@import`. --- src/components/shared/global.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/shared/global.js b/src/components/shared/global.js index 5a7ff304..94087aac 100644 --- a/src/components/shared/global.js +++ b/src/components/shared/global.js @@ -6,6 +6,10 @@ export const bodyStyles = css` font-size: ${typography.size.s3}px; color: ${color.darkest}; + margin: 0; + overflow-y: auto; + overflow-x: hidden; + -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); @@ -116,9 +120,5 @@ export const GlobalStyle = createGlobalStyle` body { ${bodyStyles} - - margin: 0; - overflow-y: auto; - overflow-x: hidden; } `;