This repository has been archived by the owner on Dec 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from JSBros/fixes
v0.2.0 Release
- Loading branch information
Showing
7 changed files
with
111 additions
and
46 deletions.
There are no files selected for viewing
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
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
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
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,27 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const Page = styled.div` | ||
${props => | ||
props.fluid | ||
? 'width: 100%;' | ||
: ` | ||
margin: 0 auto; | ||
max-width: 100%; | ||
${props.width | ||
? ` | ||
width: ${props.width}; | ||
` | ||
: 'width: 960px;' | ||
} | ||
` | ||
} | ||
`; | ||
|
||
Page.propTypes = { | ||
fluid: React.PropTypes.bool, | ||
width: React.PropTypes.string | ||
}; | ||
|
||
export default Page; | ||
|
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
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import Column from './components/Column'; | ||
import Row from './components/Row'; | ||
import Page from './components/Page'; | ||
import { divvy, media } from './utils'; | ||
|
||
const utils = { | ||
divvy, | ||
media | ||
}; | ||
|
||
export { Column, Row, utils }; | ||
export { Column, Page, Row, utils }; | ||
|
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 |
---|---|---|
@@ -1,20 +1,18 @@ | ||
import { css } from 'styled-components'; | ||
|
||
export default { | ||
sm: (...args) => css` | ||
@media (min-width: 500px) { | ||
${css(...args)} | ||
} | ||
`, | ||
md: (...args) => css` | ||
@media (min-width: 768px) { | ||
${css(...args)} | ||
} | ||
`, | ||
lg: (...args) => css` | ||
@media (min-width: 1100px) { | ||
const sizes = { | ||
sm: 500, | ||
md: 768, | ||
lg: 1100 | ||
}; | ||
|
||
export default Object.keys(sizes).reduce((acc, label) => { | ||
const accumulator = acc; | ||
accumulator[label] = (...args) => css` | ||
@media (min-width: ${sizes[label]}px) { | ||
${css(...args)} | ||
} | ||
`, | ||
}; | ||
`; | ||
return accumulator; | ||
}, {}); | ||
|