Skip to content

Commit

Permalink
[Grid] Add root class (#15163)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored and oliviertassinari committed Apr 2, 2019
1 parent 5a0a15f commit 03e01e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/material-ui/src/Grid/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function generateGutter(theme, breakpoint) {
// flexWrap: 'nowrap',
// justifyContent: 'flex-start',
export const styles = theme => ({
/* Styles applied to the root element */
root: {},
/* Styles applied to the root element if `container={true}`. */
container: {
boxSizing: 'border-box',
Expand Down Expand Up @@ -216,6 +218,7 @@ const Grid = React.forwardRef((props, ref) => {
} = props;

const className = clsx(
classes.root,
{
[classes.container]: container,
[classes.item]: item,
Expand Down
4 changes: 3 additions & 1 deletion packages/material-ui/src/Grid/Grid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ describe('<Grid />', () => {
});

describeConformance(<Grid />, () => ({
classes,
inheritComponent: 'div',
mount,
only: ['refForwarding'],
refInstanceof: window.HTMLDivElement,
testComponentPropWith: 'span',
}));

it('should render', () => {
Expand Down
1 change: 1 addition & 0 deletions pages/api/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ This property accepts the following keys:

| Name | Description |
|:-----|:------------|
| <span class="prop-name">root</span> | Styles applied to the root element
| <span class="prop-name">container</span> | Styles applied to the root element if `container={true}`.
| <span class="prop-name">item</span> | Styles applied to the root element if `item={true}`.
| <span class="prop-name">zeroMinWidth</span> | Styles applied to the root element if `zeroMinWidth={true}`.
Expand Down

0 comments on commit 03e01e3

Please sign in to comment.