Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui] Add paperChannel token #41447

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/mui-material/src/styles/CssVarsProvider.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ describe('[Material UI] CssVarsProvider', () => {
paper: 'var(--mui-palette-background-paper)',
default: 'var(--mui-palette-background-default)',
defaultChannel: 'var(--mui-palette-background-defaultChannel)',
paperChannel: 'var(--mui-palette-background-paperChannel)',
}),
);
expect(screen.getByTestId('palette-action').textContent).to.equal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export type Overlays = [

export interface PaletteBackgroundChannel {
defaultChannel: string;
paperChannel: string;
}

export interface PaletteCommonChannel {
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-material/src/styles/experimental_extendTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ export default function extendTheme(options = {}, ...args) {
// MUI X - DataGrid needs this token.
setColorChannel(palette.background, 'default');

// added for consistency with the `background.default` token
setColorChannel(palette.background, 'paper');

setColorChannel(palette.common, 'background');
setColorChannel(palette.common, 'onBackground');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ describe('experimental_extendTheme', () => {
expect(theme.colorSchemes.dark.palette.background.defaultChannel).to.equal('18 18 18');
expect(theme.colorSchemes.light.palette.background.defaultChannel).to.equal('255 255 255');

expect(theme.colorSchemes.dark.palette.background.paperChannel).to.equal('18 18 18');
expect(theme.colorSchemes.light.palette.background.paperChannel).to.equal('255 255 255');
danilo-leal marked this conversation as resolved.
Show resolved Hide resolved

expect(theme.colorSchemes.dark.palette.primary.mainChannel).to.equal('144 202 249');
expect(theme.colorSchemes.dark.palette.primary.darkChannel).to.equal('66 165 245');
expect(theme.colorSchemes.dark.palette.primary.lightChannel).to.equal('227 242 253');
Expand Down
Loading