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

[typescript] [createMuiTheme] Fix typings & deepmerge shape #11993

Merged
merged 6 commits into from
Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion packages/material-ui/src/styles/createMuiTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ function createMuiTheme(options: Object = {}) {
palette,
props: {}, // Inject custom properties
shadows: shadowsInput || shadows,
shape,
typography: createTypography(palette, typographyInput),
...deepmerge(
{
transitions,
spacing,
zIndex,
shape
},
other,
),
Expand Down
7 changes: 4 additions & 3 deletions packages/material-ui/src/styles/createPalette.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ interface TypeBackground {
paper: string;
}

type TypeDivider = string;

export type PaletteColorOptions = SimplePaletteColorOptions | Partial<Color>;

export interface SimplePaletteColorOptions {
Expand All @@ -40,6 +42,7 @@ export interface PaletteColor {
export interface TypeObject {
text: TypeText;
action: TypeAction;
divider: TypeDivider;
background: TypeBackground;
}

Expand All @@ -56,7 +59,7 @@ export interface Palette {
error: PaletteColor;
grey: Color;
text: TypeText;
divider: string;
divider: TypeDivider;
action: TypeAction;
background: TypeBackground;
getContrastText: (background: string) => string;
Expand Down Expand Up @@ -85,6 +88,4 @@ export interface PaletteOptions {
getContrastText?: (background: string) => string;
}

//export type PaletteOptions = DeepPartial<Palette>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was commented out. Why do we want to preserve the commented out code?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why it was commented out; Let's remove it then :)


export default function createPalette(palette: PaletteOptions): Palette;