Skip to content

Commit

Permalink
📝 Update the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Pradat authored and oliviertassinari committed Feb 13, 2020
1 parent bdd47db commit 8a3d68e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/pages/api/css-baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Kickstart an elegant, consistent, and simple baseline to build upon.
| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | <span class="prop-default">null</span> | You can wrap a node. |
| <span class="prop-name">scopeToChildren</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If true the css baseline is only applied to the children |

The component cannot hold a ref.

Expand Down
17 changes: 17 additions & 0 deletions docs/src/pages/components/css-baseline/css-baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ export default function MyApp() {
}
```

## Scoping on children

It's possible to apply the baseline only on the children by setting the prop `scopeToChildren` to true.

```jsx
import React from 'react';
import CssBaseline from '@material-ui/core/CssBaseline';

export default function MyApp() {
return (
<CssBaseline scopeToChildren>
{/* The rest of your application */}
</CssBaseline>
);
}
```

## Approach

### Page
Expand Down
3 changes: 3 additions & 0 deletions packages/material-ui/src/CssBaseline/CssBaseline.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ CssBaseline.propTypes = {
* You can wrap a node.
*/
children: PropTypes.node,
/**
* If true the css baseline is only applied to the children
*/
scopeToChildren: PropTypes.bool,
};

Expand Down

0 comments on commit 8a3d68e

Please sign in to comment.