Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
feat(stories): demonstrate fully stretched grid
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaringe committed Jan 3, 2017
1 parent 890f495 commit 445e966
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import '../lib/styles/semantic.css'
import './styles.css'
import { configure } from '@kadira/storybook'

const req = require.context('../src/', true, /.stories.js$/)
Expand Down
3 changes: 3 additions & 0 deletions .storybook/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#root {
height: 100%;
}
41 changes: 41 additions & 0 deletions src/grid/grid.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react'
import { storiesOf } from '@kadira/storybook'
import { withKnobs, object } from '@kadira/storybook-addon-knobs'
import Grid from './Grid'

const stories = storiesOf('core.Grid', module)

.addDecorator(withKnobs)
.add('full & even', () => {
const colProps = object('column properties', {
verticalAlign: null,
textAlign: 'center'
})
const styles = object('styles', {
root: {
height: '100%'
},
a: {
backgroundColor: 'red'
},
b: {
backgroundColor: 'blue'
},
c: {
backgroundColor: 'pink'
},
d: {
backgroundColor: 'salmon'
}
})
return (
<Grid style={styles.root}>
<Grid.Column style={styles.a} width={8} {...colProps}>A (note, the parent component must be also have the full height/width)</Grid.Column>
<Grid.Column style={styles.b} width={8} {...colProps}>B - full size no gutter semantic-ui grid! http://jsfiddle.net/ea04tkwo/. We've stretched #root's height in .storybook/styles.css</Grid.Column>
<Grid.Column style={styles.c} width={8} {...colProps}>C - maximize this viewports root? https://github.com/storybooks/react-storybook/issues/131</Grid.Column>
<Grid.Column style={styles.d} width={8} {...colProps}>D</Grid.Column>
</Grid>
)
})

export default stories

0 comments on commit 445e966

Please sign in to comment.