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

Commit

Permalink
Various doc fixes following defaults refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdwheatley committed Mar 4, 2019
1 parent 43b1498 commit 40ac0c6
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
2 changes: 0 additions & 2 deletions docs/color/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { Color, Container, Box, Text } from './'
```js
const Text = styled.h1`
${color.white}
${border.solid}
${border.blue}
${background.color.black}
`
```
Expand Down
2 changes: 1 addition & 1 deletion docs/layout/direction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Container = styled.div`
const Box = styled.div`
${size.height.medium}
${size.width.third}
${({ light }) => (light ? background.red : background.black)}
${({ light }) => (light ? background.color.red : background.color.black)}
`
```

Expand Down
11 changes: 7 additions & 4 deletions docs/props/emotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { background, color } from '../../src'

export const Styled = styled.h1`
${props => props.invert && color.white}
${props => (props.invert ? background.black : background.white)}
${props => (props.invert ? background.color.black : background.color.white)}
`

export const CSSProp = ({ children, invert }) => {
return (
<h1
css={css`
${invert && color.white}
${invert ? background.black : background.white}
${invert ? background.color.black : background.color.white}
`}>
{children}
</h1>
Expand All @@ -22,12 +22,15 @@ export const CSSProp = ({ children, invert }) => {

export const Array = ({ children, invert }) => (
<h1
css={[invert && color.white, invert ? background.black : background.white]}>
css={[
invert && color.white,
invert ? background.color.black : background.color.white
]}>
{children}
</h1>
)

export const ObjectLiteral = styled.h1(props => ({
...(props.invert && color.white),
...(props.invert ? background.black : background.white)
...(props.invert ? background.color.black : background.color.white)
}))
11 changes: 7 additions & 4 deletions docs/props/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Styling based on props can be achieved in a variety of different ways depending
```jsx
const Text = styled.h1`
${props => props.invert && color.white}
${props => (props.invert ? background.black : background.white)}
${props => (props.invert ? background.color.black : background.color.white)}
`
```

Expand All @@ -52,7 +52,7 @@ const Text = ({ children, invert }) => {
<h1
css={css`
${invert && color.white}
${invert ? background.black : background.white}
${invert ? background.color.black : background.color.white}
`}
>
{children}
Expand All @@ -74,7 +74,10 @@ const Text = ({ children, invert }) => {
```jsx
const Text = ({ children, invert }) => (
<h1
css={[invert && color.white, invert ? background.black : background.white]}
css={[
invert && color.white,
invert ? background.color.black : background.color.white
]}
>
{children}
</h1>
Expand All @@ -94,6 +97,6 @@ const Text = ({ children, invert }) => (
```jsx
const Text = styled.h1(props => ({
...(props.invert && color.white),
...(props.invert ? background.black : background.white)
...(props.invert ? background.color.black : background.color.white)
}))
```
11 changes: 7 additions & 4 deletions docs/props/styled-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { background, color } from '../../src'

export const Styled = styled.h1`
${props => props.invert && color.white}
${props => (props.invert ? background.black : background.white)}
${props => (props.invert ? background.color.black : background.color.white)}
`

export const CSSProp = ({ children, invert }) => {
return (
<h1
css={css`
${invert && color.white}
${invert ? background.black : background.white}
${invert ? background.color.black : background.color.white}
`}>
{children}
</h1>
Expand All @@ -21,12 +21,15 @@ export const CSSProp = ({ children, invert }) => {

export const Array = ({ children, invert }) => (
<h1
css={[invert && color.white, invert ? background.black : background.white]}>
css={[
invert && color.white,
invert ? background.color.black : background.color.white
]}>
{children}
</h1>
)

export const ObjectLiteral = styled.h1(props => ({
...(props.invert && color.white),
...(props.invert ? background.black : background.white)
...(props.invert ? background.color.black : background.color.white)
}))
2 changes: 1 addition & 1 deletion docs/shadow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { background, shadow, size } from '../../src'

export const Shadow = styled.h1`
${size.height.medium}
${background.black}
${background.color.black}
${shadow.large}
`
2 changes: 1 addition & 1 deletion docs/shadow/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Shadow } from './'
```js
const Box = styled.h1`
${size.height.medium}
${background.black}
${background.color.black}
${shadow.large}
`
```
Expand Down
2 changes: 1 addition & 1 deletion docs/size/height.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Height } from './'

```js
const Box = styled.div`
${size.height.large}
${size.height.medium}
${background.color.black}
`
```
Expand Down

0 comments on commit 40ac0c6

Please sign in to comment.