-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): add story for colors + yarncache
- Loading branch information
1 parent
46cf039
commit b848553
Showing
5 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import styled from 'styled-components' | ||
|
||
import { generateStoryDecorator } from '../.storybook/components/StoryDecorator' | ||
import { THEME } from '../src' | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
flex-wrap: wrap; | ||
` | ||
const ColorSample = styled.div` | ||
width: 120px; | ||
height: 120px; | ||
margin: 5px; | ||
display: inline-block; | ||
background-color: ${props => props.color}; | ||
border: 1px solid black; | ||
> span { | ||
color: white; | ||
filter: drop-shadow(1px 1px 0px black); | ||
} | ||
` | ||
|
||
export default { | ||
title: 'Colors', | ||
component: ColorSample, | ||
decorators: [generateStoryDecorator()] | ||
} | ||
|
||
export function _Colors() { | ||
return ( | ||
<Wrapper> | ||
{Object.entries(THEME.color).map(([key, value]) => { | ||
if (typeof value === 'object') { | ||
return Object.entries(value).map(([key2, value2]) => ( | ||
<ColorSample key={key2} color={value2}> | ||
<span> | ||
{key}.{key2} <br /> {value2} | ||
</span> | ||
</ColorSample> | ||
)) | ||
} | ||
|
||
return ( | ||
<ColorSample key={key} color={value}> | ||
<span> | ||
{key} <br /> {value} | ||
</span> | ||
</ColorSample> | ||
) | ||
})} | ||
</Wrapper> | ||
) | ||
} |
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