mui-app-theme
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -15,2 +15,3 @@ import { Direction, Theme, Transitions } from "@material-ui/core"; | ||
import { IAppThemeTypography } from "./IAppThemeTypography"; | ||
import { ICreateAppThemeOptions } from "./ICreateAppThemeOptions"; | ||
export declare class AppTheme implements Theme, IAppTheme { | ||
@@ -30,3 +31,3 @@ breakpoints: Breakpoints; | ||
zIndex: ZIndex; | ||
constructor(theme: Theme, colors: IAppThemeColors, typography: IAppThemeTypography); | ||
constructor(theme: Theme, options: ICreateAppThemeOptions); | ||
} |
export class AppTheme { | ||
constructor(theme, colors, typography) { | ||
constructor(theme, options) { | ||
this.breakpoints = theme.breakpoints; | ||
@@ -13,7 +13,7 @@ this.direction = theme.direction; | ||
this.transitions = theme.transitions; | ||
this.typography = Object.assign(Object.assign({}, theme.typography), typography); | ||
this.typography = Object.assign(Object.assign({}, theme.typography), options.themeTypography); | ||
this.zIndex = theme.zIndex; | ||
this.colors = colors; | ||
this.colors = options.themeColors; | ||
} | ||
} | ||
//# sourceMappingURL=AppTheme.js.map |
import { IAppTheme } from "./IAppTheme"; | ||
import { IAppThemeColors } from "./IAppThemeColors"; | ||
import { IAppThemeTypography } from "./IAppThemeTypography"; | ||
export declare function createAppTheme(themeColors?: IAppThemeColors, themeTypography?: IAppThemeTypography): IAppTheme; | ||
import { ICreateAppThemeOptions } from "./ICreateAppThemeOptions"; | ||
export declare function createAppTheme(options?: ICreateAppThemeOptions): IAppTheme; |
import createMuiTheme from "@material-ui/core/styles/createMuiTheme"; | ||
import { AppTheme } from "./AppTheme"; | ||
import { AppThemeColors } from "./AppThemeColors"; | ||
import { AppThemeTypography } from "./AppThemeTypography"; | ||
import { DefaultCreateAppThemeOptions } from "./DefaultCreateAppThemeOptions"; | ||
import { overrideMaterialUIPalette, overrideMaterialUIStyles } from "./overrides"; | ||
export function createAppTheme(themeColors = new AppThemeColors(), themeTypography = new AppThemeTypography()) { | ||
const overriddenPalette = overrideMaterialUIPalette(themeColors); | ||
const overriddenStyles = overrideMaterialUIStyles(themeColors); | ||
export function createAppTheme(options = new DefaultCreateAppThemeOptions()) { | ||
if (!options.themeColors) { | ||
options.themeColors = DefaultCreateAppThemeOptions.DefaultAppThemeColors(); | ||
} | ||
if (!options.themeTypography) { | ||
options.themeTypography = DefaultCreateAppThemeOptions.DefaultAppThemeTypography(); | ||
} | ||
const overriddenPalette = overrideMaterialUIPalette(options.themeColors); | ||
const overriddenStyles = overrideMaterialUIStyles(options.themeColors); | ||
const muiTheme = createMuiTheme({ | ||
@@ -13,5 +18,5 @@ palette: overriddenPalette, | ||
}); | ||
const appTheme = new AppTheme(muiTheme, themeColors, themeTypography); | ||
const appTheme = new AppTheme(muiTheme, options); | ||
return appTheme; | ||
} | ||
//# sourceMappingURL=createAppTheme.js.map |
{ | ||
"name": "mui-app-theme", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Allow to override material ui theme colors", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43752
108
637