1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-20 10:06:07 +07:00

Refactor: move styles utils to theme (#363)

This commit is contained in:
Priscila Oliveira
2019-12-12 12:10:27 -03:00
committed by GitHub
parent 172e470780
commit fd99be6818
25 changed files with 130 additions and 216 deletions

View File

@@ -28,6 +28,44 @@ const colors = {
export type Colors = keyof typeof colors;
const fontSize = {
xxl: 26,
xl: 24,
lg: 21,
md: 18,
default: 16,
sm: 14,
};
export type FontSize = keyof typeof fontSize;
const fontWeight = {
light: 300,
regular: 400,
semiBold: 500,
bold: 700,
};
export type FontWeight = keyof typeof fontWeight;
export const breakPoints = {
small: 576,
medium: 768,
large: 1024,
container: 1240,
xlarge: 1275,
};
export type BreakPoints = typeof breakPoints;
const customizedTheme = {
fontSize,
fontWeight,
breakPoints,
};
type CustomizedTheme = typeof customizedTheme;
export const theme = createMuiTheme({
typography: {
fontFamily: 'inherit',
@@ -38,10 +76,18 @@ export const theme = createMuiTheme({
secondary: { main: colors.secondary },
error: { main: colors.red },
},
...customizedTheme,
});
export type Theme = typeof theme;
declare module '@material-ui/core/styles/createMuiTheme' {
/* eslint-disable-next-line @typescript-eslint/no-empty-interface */
interface Theme extends CustomizedTheme {}
/* eslint-disable-next-line @typescript-eslint/no-empty-interface */
interface ThemeOptions extends CustomizedTheme {}
}
declare module '@material-ui/core/styles/createPalette' {
interface CustomPalette {
black: string;