Skip to content

Commit

Permalink
Merge pull request threepointone#317 from bvaughn/docs-nested-example
Browse files Browse the repository at this point in the history
Added example to child-selectors of using Glamor-generated class names
  • Loading branch information
threepointone authored Sep 11, 2017
2 parents 9db1295 + f0dd3cb commit 667b480
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/howto.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,31 @@ let box = css(

```

It's also possible to use Glamor's generated `classNames` for nested styles:

glamor
```jsx
import { css } from 'glamor'

const child = css({
// Child styles ...
});
const parent = css({
// Parent styles ...

[`& .${child}`]: {
// Nested child styles
}
});

// ...

<div className={parent}>
<div className={child}>...</div>
</div>

```

your components could also accept props to be merged into the component

```jsx
Expand Down

0 comments on commit 667b480

Please sign in to comment.