Skip to content

Commit 9aec566

Browse files
authored
[material-ui] Add paperChannel token (#41447)
1 parent be6c430 commit 9aec566

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

packages/mui-material/src/styles/CssVarsProvider.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ describe('[Material UI] CssVarsProvider', () => {
153153
paper: 'var(--mui-palette-background-paper)',
154154
default: 'var(--mui-palette-background-default)',
155155
defaultChannel: 'var(--mui-palette-background-defaultChannel)',
156+
paperChannel: 'var(--mui-palette-background-paperChannel)',
156157
}),
157158
);
158159
expect(screen.getByTestId('palette-action').textContent).to.equal(

packages/mui-material/src/styles/experimental_extendTheme.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export type Overlays = [
6969

7070
export interface PaletteBackgroundChannel {
7171
defaultChannel: string;
72+
paperChannel: string;
7273
}
7374

7475
export interface PaletteCommonChannel {

packages/mui-material/src/styles/experimental_extendTheme.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ export default function extendTheme(options = {}, ...args) {
344344
// MUI X - DataGrid needs this token.
345345
setColorChannel(palette.background, 'default');
346346

347+
// added for consistency with the `background.default` token
348+
setColorChannel(palette.background, 'paper');
349+
347350
setColorChannel(palette.common, 'background');
348351
setColorChannel(palette.common, 'onBackground');
349352

packages/mui-material/src/styles/experimental_extendTheme.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ describe('experimental_extendTheme', () => {
5959
expect(theme.colorSchemes.dark.palette.background.defaultChannel).to.equal('18 18 18');
6060
expect(theme.colorSchemes.light.palette.background.defaultChannel).to.equal('255 255 255');
6161

62+
expect(theme.colorSchemes.dark.palette.background.paperChannel).to.equal('18 18 18');
63+
expect(theme.colorSchemes.light.palette.background.paperChannel).to.equal('255 255 255');
64+
6265
expect(theme.colorSchemes.dark.palette.primary.mainChannel).to.equal('144 202 249');
6366
expect(theme.colorSchemes.dark.palette.primary.darkChannel).to.equal('66 165 245');
6467
expect(theme.colorSchemes.dark.palette.primary.lightChannel).to.equal('227 242 253');

0 commit comments

Comments
 (0)