UNPKG

@material-ui/core

Version:

React components that implement Google's Material Design.

58 lines (53 loc) 1.86 kB
import { Breakpoints, BreakpointsOptions } from './createBreakpoints'; import { Mixins, MixinsOptions } from './createMixins'; import { Palette, PaletteOptions } from './createPalette'; import { Typography, TypographyOptions } from './createTypography'; import { Shadows } from './shadows'; import { Shape, ShapeOptions } from './shape'; import { Spacing, SpacingOptions } from './createSpacing'; import { Transitions, TransitionsOptions } from './transitions'; import { ZIndex, ZIndexOptions } from './zIndex'; import { Overrides } from './overrides'; import { Variants } from './variants'; import { ComponentsProps } from './props'; export type Direction = 'ltr' | 'rtl'; export interface ThemeOptions { shape?: ShapeOptions; breakpoints?: BreakpointsOptions; direction?: Direction; mixins?: MixinsOptions; overrides?: Overrides; palette?: PaletteOptions; props?: ComponentsProps; shadows?: Shadows; spacing?: SpacingOptions; transitions?: TransitionsOptions; typography?: TypographyOptions | ((palette: Palette) => TypographyOptions); variants?: Variants; zIndex?: ZIndexOptions; unstable_strictMode?: boolean; } export interface Theme { shape: Shape; breakpoints: Breakpoints; direction: Direction; mixins: Mixins; overrides?: Overrides; palette: Palette; props?: ComponentsProps; shadows: Shadows; spacing: Spacing; transitions: Transitions; typography: Typography; variants?: Variants; zIndex: ZIndex; unstable_strictMode?: boolean; } /** * Generate a theme base on the options received. * * @param options Takes an incomplete theme object and adds the missing parts. * @param args Deep merge the arguments with the about to be returned theme. * @returns A complete, ready to use theme object. */ export default function createMuiTheme(options?: ThemeOptions, ...args: object[]): Theme;