Skip to content

Commit

Permalink
Edit responsive styles doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnblk committed Mar 23, 2019
1 parent 3ea12c0 commit d7d4581
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/responsive-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,34 @@ All style utilities add props that accept arrays as values for mobile-first resp
<Box p={[ 1, 2, 3, 4 ]} />
```

## What it does

This shortcut is an alternative to writing media queries out by hand.
Given the following:

```jsx
<Box width={[ 1, 1/2, 1/4 ]} />
```

Using Styled System with a CSS-in-JS library will generate something like the following CSS:

```css
.Box-hash {
width: 100%;
}

@media screen and (min-width: 40em) {
.Box-hash {
width: 50%;
}
}

@media screen and (min-width: 52em) {
.Box-hash {
width: 25%;
}
}
```

## Using objects

Expand Down

0 comments on commit d7d4581

Please sign in to comment.