-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CssBaseline] Migrate ScopedCssBaseline to emotion (#25541)
- Loading branch information
Showing
9 changed files
with
133 additions
and
44 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
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
19 changes: 10 additions & 9 deletions
19
packages/material-ui/src/ScopedCssBaseline/ScopedCssBaseline.test.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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import * as React from 'react'; | ||
import { getClasses, createMount, describeConformance } from 'test/utils'; | ||
import ScopedCssBaseline from './ScopedCssBaseline'; | ||
import { createMount, describeConformanceV5, createClientRender } from 'test/utils'; | ||
import ScopedCssBaseline, { | ||
scopedCssBaselineClasses as classes, | ||
} from '@material-ui/core/ScopedCssBaseline'; | ||
|
||
describe('<ScopedCssBaseline />', () => { | ||
const render = createClientRender(); | ||
const mount = createMount(); | ||
let classes; | ||
|
||
before(() => { | ||
classes = getClasses(<ScopedCssBaseline />); | ||
}); | ||
|
||
describeConformance(<ScopedCssBaseline />, () => ({ | ||
describeConformanceV5(<ScopedCssBaseline />, () => ({ | ||
classes, | ||
inheritComponent: 'div', | ||
mount, | ||
render, | ||
muiName: 'MuiScopedCssBaseline', | ||
refInstanceof: window.HTMLDivElement, | ||
skip: ['componentProp'], | ||
testComponentPropWith: 'span', | ||
skip: ['componentsProp', 'themeVariants'], | ||
})); | ||
}); |
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,2 +1,5 @@ | ||
export { default } from './ScopedCssBaseline'; | ||
export * from './ScopedCssBaseline'; | ||
|
||
export { default as scopedCssBaselineClasses } from './scopedCssBaselineClasses'; | ||
export * from './scopedCssBaselineClasses'; |
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 +1,4 @@ | ||
export { default } from './ScopedCssBaseline'; | ||
|
||
export { default as scopedCssBaselineClasses } from './scopedCssBaselineClasses'; | ||
export * from './scopedCssBaselineClasses'; |
7 changes: 7 additions & 0 deletions
7
packages/material-ui/src/ScopedCssBaseline/scopedCssBaselineClasses.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,7 @@ | ||
import { ScopedCssBaselineClassKey } from './ScopedCssBaseline'; | ||
|
||
declare const ScopedCssBaselineClasses: Record<ScopedCssBaselineClassKey, string>; | ||
|
||
export function getScopedCssBaselineUtilityClass(slot: string): string; | ||
|
||
export default ScopedCssBaselineClasses; |
9 changes: 9 additions & 0 deletions
9
packages/material-ui/src/ScopedCssBaseline/scopedCssBaselineClasses.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,9 @@ | ||
import { generateUtilityClass, generateUtilityClasses } from '@material-ui/unstyled'; | ||
|
||
export function getScopedCssBaselineUtilityClass(slot) { | ||
return generateUtilityClass('MuiScopedCssBaseline', slot); | ||
} | ||
|
||
const ScopedCssBaselineClasses = generateUtilityClasses('MuiScopedCssBaseline', ['root']); | ||
|
||
export default ScopedCssBaselineClasses; |