Skip to content

Commit

Permalink
restructure a bit the docs page for the Box
Browse files Browse the repository at this point in the history
  • Loading branch information
mnajdova committed Oct 23, 2020
1 parent 615cb47 commit 783ff53
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/src/pages/components/box/box.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ It's created using the `experimentalStyled()` function of `@material-ui/core/sty

[The palette](/system/palette/) style function.

## The sx prop

All system properties, are available via the `sx` prop. This property allows you to specify any CSS rules you may need, in addition to the ones already available as part of the system. Here is an example of how you can use it:

{{"demo": "pages/components/box/BoxSx.js", "defaultCodeOpen": true }}

## Overriding Material-UI components

The Box component wraps your component.
Expand All @@ -28,7 +34,7 @@ This works great when the changes can be isolated to a new DOM element.
For instance, you can change the margin this way.

However, sometimes you have to target the underlying DOM element.
For instance, you want to change the border of the button.
For instance, you want to change the border of the Button.
The Button component defines its own styles. CSS inheritance doesn't help.
To workaround the problem, you have two options:

Expand All @@ -47,12 +53,6 @@ The Box children accepts a render props function. You can pull out the `classNam
> ⚠️ The CSS specificity relies on the import order.
> If you want the guarantee that the wrapped component's style will be overridden, you need to import the Box last.
## The sx prop

All system props, are available via the `sx` prop. This property allows you to specify any CSS rules you may need, in addition to the ones already available as part of the system. Here is an example of how you can use it:

{{"demo": "pages/components/box/BoxSx.js", "defaultCodeOpen": true }}

## API

```jsx
Expand Down

0 comments on commit 783ff53

Please sign in to comment.