-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add GlobalStyles API (#25191)
- Loading branch information
Showing
14 changed files
with
121 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './global-styles.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return <ApiPage descriptions={descriptions} pageContent={pageContent} />; | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context( | ||
'docs/translations/api-docs/global-styles', | ||
false, | ||
/global-styles.*.json$/, | ||
); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
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,18 @@ | ||
{ | ||
"props": { | ||
"styles": { | ||
"type": { | ||
"name": "union", | ||
"description": "func<br>| number<br>| object<br>| { __emotion_styles: any }<br>| string<br>| bool" | ||
} | ||
} | ||
}, | ||
"name": "GlobalStyles", | ||
"styles": { "classes": [], "globalClasses": {}, "name": null }, | ||
"spread": true, | ||
"filename": "/packages/material-ui/src/GlobalStyles/GlobalStyles.js", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/customization/how-to-customize/\">How To Customize</a></li></ul>", | ||
"styledComponent": true, | ||
"cssComponent": false | ||
} |
4 changes: 4 additions & 0 deletions
4
docs/src/pages/customization/how-to-customize/how-to-customize.md
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
5 changes: 5 additions & 0 deletions
5
docs/translations/api-docs/global-styles/global-styles-de.json
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/translations/api-docs/global-styles/global-styles-es.json
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/translations/api-docs/global-styles/global-styles-fr.json
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/translations/api-docs/global-styles/global-styles-ja.json
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/translations/api-docs/global-styles/global-styles-pt.json
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/translations/api-docs/global-styles/global-styles-ru.json
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/translations/api-docs/global-styles/global-styles-zh.json
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
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,5 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { "styles": "The styles you want to apply globally." }, | ||
"classDescriptions": {} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import { GlobalStylesProps } from '@material-ui/styled-engine'; | ||
import { DistributiveOmit } from '@material-ui/types'; | ||
import { GlobalStylesProps as StyledGlobalStylesProps } from '@material-ui/styled-engine'; | ||
|
||
export interface GlobalStylesProps { | ||
/** | ||
* The styles you want to apply globally. | ||
*/ | ||
styles: StyledGlobalStylesProps['styles']; | ||
} | ||
|
||
/** | ||
* | ||
* Demos: | ||
* | ||
* - [How To Customize](https://material-ui.com/customization/how-to-customize/) | ||
* | ||
* API: | ||
* | ||
* - [Global API](https://material-ui.com/api/global/) | ||
* - [GlobalStyles API](https://material-ui.com/api/global-styles/) | ||
*/ | ||
export default function GlobalStyles( | ||
props: DistributiveOmit<GlobalStylesProps, 'defaultTheme'> | ||
): React.ReactElement; | ||
export default function GlobalStyles(props: GlobalStylesProps): React.ReactElement; |
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