theme.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. import {
  2. // for strict mode
  3. unstable_createMuiStrictModeTheme as createMuiTheme,
  4. } from '@material-ui/core/styles';
  5. declare module '@material-ui/core/styles/createPalette' {
  6. interface Palette {
  7. milvusBlue: Palette['primary'];
  8. milvusGrey: Palette['primary'];
  9. }
  10. interface PaletteOptions {
  11. milvusBlue: PaletteOptions['primary'];
  12. milvusGrey: PaletteOptions['primary'];
  13. }
  14. }
  15. const commonThemes = {
  16. typography: {
  17. fontFamily: [
  18. 'Roboto',
  19. '-apple-system',
  20. 'BlinkMacSystemFont',
  21. '"Segoe UI"',
  22. '"Helvetica Neue"',
  23. 'Arial',
  24. 'sans-serif',
  25. '"Apple Color Emoji"',
  26. '"Segoe UI Emoji"',
  27. '"Segoe UI Symbol"',
  28. ].join(','),
  29. },
  30. palette: {
  31. primary: {
  32. main: '#06aff2',
  33. light: '#bfdeff',
  34. dark: '#0689D2',
  35. },
  36. secondary: {
  37. light: '#82d3ba',
  38. main: '#31b78d',
  39. dark: '#279371',
  40. },
  41. error: {
  42. main: '#ff4605',
  43. light: '#ff8f68',
  44. dark: '#cd3804',
  45. },
  46. milvusBlue: {
  47. main: '#f8f8fc',
  48. dark: '#dcdce3',
  49. },
  50. milvusGrey: {
  51. main: '#aeaebb',
  52. light: '#dcdce3',
  53. dark: '#82838e',
  54. contrastText: '#f8f8fc',
  55. },
  56. },
  57. breakpoints: {
  58. values: {
  59. xs: 0,
  60. sm: 600,
  61. md: 1025,
  62. lg: 1200,
  63. xl: 1920,
  64. },
  65. },
  66. spacing: (factor: number) => `${8 * factor}px`,
  67. };
  68. export const theme = createMuiTheme({
  69. ...commonThemes,
  70. overrides: {
  71. MuiTypography: {
  72. button: {
  73. textTransform: 'initial',
  74. lineHeight: '16px',
  75. fontWeight: 'bold',
  76. },
  77. h1: {
  78. fontSize: '36px',
  79. lineHeight: '42px',
  80. fontWeight: 'bold',
  81. letterSpacing: '-0.02em',
  82. },
  83. h2: {
  84. lineHeight: '24px',
  85. fontSize: '28px',
  86. fontWeight: 'bold',
  87. },
  88. h3: {
  89. lineHeight: '20px',
  90. fontSize: '24px',
  91. fontWeight: 'bold',
  92. },
  93. h4: {
  94. fontWeight: 500,
  95. lineHeight: '23px',
  96. fontSize: '20px',
  97. letterSpacing: '-0.02em',
  98. },
  99. h5: {
  100. fontWeight: 'bold',
  101. fontSize: '16px',
  102. lineHeight: '24px',
  103. },
  104. h6: {
  105. fontWeight: 'normal',
  106. fontSize: '16px',
  107. lineHeight: '24px',
  108. letterSpacing: '-0.01em',
  109. },
  110. // style for element p
  111. body1: {
  112. fontSize: '14px',
  113. lineHeight: '20px',
  114. },
  115. // small caption
  116. body2: {
  117. fontSize: '12px',
  118. lineHeight: '16px',
  119. },
  120. // tiny caption
  121. caption: {
  122. fontSize: '10px',
  123. lineHeight: '12px',
  124. },
  125. },
  126. MuiButton: {
  127. root: {
  128. textTransform: 'initial',
  129. fontWeight: 'bold',
  130. },
  131. text: {
  132. '&:hover': {
  133. backgroundColor: commonThemes.palette.primary.light,
  134. },
  135. },
  136. },
  137. MuiDialogActions: {
  138. spacing: {
  139. padding: commonThemes.spacing(4),
  140. },
  141. },
  142. MuiDialogContent: {
  143. root: {
  144. padding: `${commonThemes.spacing(1)} ${commonThemes.spacing(4)}`,
  145. },
  146. },
  147. MuiDialogTitle: {
  148. root: {
  149. padding: commonThemes.spacing(4),
  150. paddingBottom: commonThemes.spacing(1),
  151. },
  152. },
  153. MuiFormHelperText: {
  154. contained: {
  155. marginLeft: 0,
  156. },
  157. },
  158. },
  159. });