1 | import { Palette } from './createPalette';
|
2 | import * as React from 'react';
|
3 | import { CSSProperties } from './withStyles';
|
4 |
|
5 | export type Variant =
|
6 | | 'h1'
|
7 | | 'h2'
|
8 | | 'h3'
|
9 | | 'h4'
|
10 | | 'h5'
|
11 | | 'h6'
|
12 | | 'subtitle1'
|
13 | | 'subtitle2'
|
14 | | 'body1'
|
15 | | 'body2'
|
16 | | 'caption'
|
17 | | 'button'
|
18 | | 'overline';
|
19 |
|
20 | export interface FontStyle
|
21 | extends Required<{
|
22 | fontFamily: React.CSSProperties['fontFamily'];
|
23 | fontSize: number;
|
24 | fontWeightLight: React.CSSProperties['fontWeight'];
|
25 | fontWeightRegular: React.CSSProperties['fontWeight'];
|
26 | fontWeightMedium: React.CSSProperties['fontWeight'];
|
27 | fontWeightBold: React.CSSProperties['fontWeight'];
|
28 | }> {}
|
29 |
|
30 | export interface FontStyleOptions extends Partial<FontStyle> {
|
31 | htmlFontSize?: number;
|
32 | allVariants?: React.CSSProperties;
|
33 | }
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export type TypographyStyle = CSSProperties;
|
39 | export interface TypographyStyleOptions extends TypographyStyle {}
|
40 |
|
41 | export interface TypographyUtils {
|
42 | pxToRem: (px: number) => string;
|
43 | }
|
44 |
|
45 | export interface Typography extends Record<Variant, TypographyStyle>, FontStyle, TypographyUtils {}
|
46 |
|
47 | export interface TypographyOptions
|
48 | extends Partial<Record<Variant, TypographyStyleOptions> & FontStyleOptions> {}
|
49 |
|
50 | export default function createTypography(
|
51 | palette: Palette,
|
52 | typography: TypographyOptions | ((palette: Palette) => TypographyOptions)
|
53 | ): Typography;
|