Created
May 8, 2019 20:54
-
-
Save mfix22/f2e9f4f08c683cc6520f51342b18bf49 to your computer and use it in GitHub Desktop.
CSS variables in `styled-components`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createGlobalStyle} from 'styled-components'; | |
// This becomes the source of truth for the application | |
export default const GlobalStyle = createGlobalStyle` | |
:root { | |
--primary: cyan; | |
--text: #506784; | |
--borders: #EBF0F8; | |
--page-background: transparent; | |
--nav-background: white; | |
/* add more colors */ | |
--font-primary: "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont, sans-serif; | |
--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; | |
--x1: 4px; | |
--x2: 8px; | |
--x3: 16px; | |
--x4: 24px; | |
--x5: 32px; | |
--x6: 64px; | |
--f1: 0.75rem; | |
--f2: 0.875rem; | |
--f3: 1rem; | |
--f4: 1.25rem; | |
--f5: 1.5rem; | |
--f6: 2rem; | |
/* add more variables to fill our your system */ | |
} | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment