-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a3d68e
commit 889e753
Showing
14 changed files
with
205 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import markdown from './scoped-css-basline.md'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs markdown={markdown} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
filename: /packages/material-ui/src/ScopedCssBasline/ScopedCssBasline.js | ||
--- | ||
|
||
<!--- This documentation is automatically generated, do not try to edit it. --> | ||
|
||
# ScopedCssBasline API | ||
|
||
<p class="description">The API documentation of the ScopedCssBasline React component. Learn more about the props and the CSS customization points.</p> | ||
|
||
## Import | ||
|
||
```js | ||
import ScopedCssBasline from '@material-ui/core/ScopedCssBasline'; | ||
// or | ||
import { ScopedCssBasline } from '@material-ui/core'; | ||
``` | ||
|
||
You can learn more about the difference by [reading this guide](/guides/minimizing-bundle-size/). | ||
|
||
|
||
|
||
## Props | ||
|
||
| Name | Type | Default | Description | | ||
|:-----|:-----|:--------|:------------| | ||
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. | | ||
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | ||
|
||
The `ref` is forwarded to the root element. | ||
|
||
Any other props supplied will be provided to the root element (native element). | ||
|
||
## CSS | ||
|
||
- Style sheet name: `MuiScopedCssBasline`. | ||
- Style sheet details: | ||
|
||
| Rule name | Global class | Description | | ||
|:-----|:-------------|:------------| | ||
| <span class="prop-name">root</span> | <span class="prop-name">.MuiScopedCssBasline-root</span> | Styles applied to the root element. | ||
|
||
You can override the style of the component thanks to one of these customization points: | ||
|
||
- With a rule name of the [`classes` object prop](/customization/components/#overriding-styles-with-classes). | ||
- With a [global class name](/customization/components/#overriding-styles-with-global-class-names). | ||
- With a theme and an [`overrides` property](/customization/globals/#css). | ||
|
||
If that's not sufficient, you can check the [implementation of the component](https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/ScopedCssBasline/ScopedCssBasline.js) for more detail. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/material-ui/src/ScopedCssBasline/ScopedCssBasline.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as React from 'react'; | ||
|
||
export interface ScopedCssBaselineProps { | ||
children?: React.ReactElement; | ||
} | ||
|
||
declare const ScopedCssBaseline: React.ComponentType<ScopedCssBaselineProps>; | ||
|
||
export type ScopedCssBaselineClassKey = 'root'; | ||
|
||
export default ScopedCssBaseline; |
43 changes: 43 additions & 0 deletions
43
packages/material-ui/src/ScopedCssBasline/ScopedCssBasline.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import clsx from 'clsx'; | ||
import { withStyles } from '@material-ui/core/styles'; | ||
import { html, body } from '../CssBaseline/CssBaseline'; | ||
|
||
export const styles = theme => ({ | ||
/* Styles applied to the root element. */ | ||
root: { | ||
...html, | ||
...body(theme), | ||
'& *, & *::before, & *::after': { | ||
boxSizing: 'inherit', | ||
}, | ||
'& strong, &b': { | ||
fontWeight: theme.typography.fontWeightBold, | ||
}, | ||
}, | ||
}); | ||
|
||
const ScopedCssBasline = React.forwardRef(function ScopedCssBasline(props, ref) { | ||
const { classes, className, ...other } = props; | ||
|
||
return <div className={clsx(classes.root, className)} ref={ref} {...other} />; | ||
}); | ||
|
||
ScopedCssBasline.propTypes = { | ||
/** | ||
* The content of the component. | ||
*/ | ||
children: PropTypes.node, | ||
/** | ||
* Override or extend the styles applied to the component. | ||
* See [CSS API](#css) below for more details. | ||
*/ | ||
classes: PropTypes.object, | ||
/** | ||
* @ignore | ||
*/ | ||
className: PropTypes.string, | ||
}; | ||
|
||
export default withStyles(styles, { name: 'MuiScopedCssBasline' })(ScopedCssBasline); |
Oops, something went wrong.