Created
June 6, 2019 12:55
-
-
Save GianlucaGuarini/31b6a1b086349930ec0f25eb03496ce0 to your computer and use it in GitHub Desktop.
This file contains 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
:root { | |
@import '@design-system/colors.json'; | |
--root-colors--primary: #{$primary}; | |
--root-colors--secondary: #{$secondary}; | |
} |
This file contains 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
:root { | |
// notice that these json variables are private and available only in this context! | |
@import '@design-system/sizes.json'; | |
// Notice the use of vanilla css vars to enable the editor autocomplete ;) | |
--root-sizes--y-stack: #{$y-stack}; | |
--root-sizes--x-stack: #{$x-stack}; | |
--root-sizes--border-radius: #{$border-radius}; | |
} |
This file contains 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
{ | |
"primary": "yellow", | |
"secondary": "red" | |
} |
This file contains 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
{ | |
"my-component": { | |
"id": "page-specs-id" | |
} | |
} |
This file contains 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
{ | |
"my-component": { | |
"names": ["Hover State"], | |
"ids": "0%3A7243" | |
} | |
} |
This file contains 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
.my-component { | |
// notice the aliasing with semantic names for the components inner variables | |
--text-x-padding: var(--root-sizes--y-stack); | |
--text-color: var(--root-colors--primary); | |
p { | |
color: var(--text-color); | |
padding: { | |
left: var(--text-x-padding); | |
right: var(--text-x-padding); | |
} | |
} | |
} |
This file contains 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 figma from '@design-system/figma.json'; | |
import confluence from '@design-system/confluence.json'; | |
const COMPONENT_NAME = 'my-component'; | |
const stories = storiesOf('Simple Example', module); | |
stories.add( | |
'Hover state', | |
() => <SimpleExample />, | |
{ | |
figma: figma[COMPONENT_NAME], | |
confluence: confluence[COMPONENT_NAME], | |
}, | |
); |
This file contains 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
{ | |
"y-stack": "24px", | |
"x-stack": "16px", | |
"border-radius": "8px" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment