theme.ts 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. import {
  2. // for strict mode
  3. unstable_createMuiStrictModeTheme as createMuiTheme,
  4. } from '@material-ui/core/styles';
  5. import { MuiPickersOverrides } from '@material-ui/pickers/typings/overrides';
  6. type overridesNameToClassKey = {
  7. [P in keyof MuiPickersOverrides]: keyof MuiPickersOverrides[P];
  8. };
  9. declare module '@material-ui/core/styles/overrides' {
  10. export interface ComponentNameToClassKey extends overridesNameToClassKey { }
  11. }
  12. declare module '@material-ui/core/styles/createPalette' {
  13. interface Palette {
  14. attuBlue: Palette['primary'];
  15. attuGrey: Palette['primary'];
  16. attuDark: Palette['primary'];
  17. }
  18. interface PaletteOptions {
  19. attuBlue: PaletteOptions['primary'];
  20. attuGrey: PaletteOptions['primary'];
  21. attuDark: PaletteOptions['primary'];
  22. }
  23. }
  24. const commonThemes = {
  25. typography: {
  26. fontFamily: [
  27. 'Roboto',
  28. '-apple-system',
  29. 'BlinkMacSystemFont',
  30. '"Segoe UI"',
  31. '"Helvetica Neue"',
  32. 'Arial',
  33. 'sans-serif',
  34. '"Apple Color Emoji"',
  35. '"Segoe UI Emoji"',
  36. '"Segoe UI Symbol"',
  37. ].join(','),
  38. },
  39. palette: {
  40. primary: {
  41. main: '#06aff2',
  42. light: '#bfdeff',
  43. dark: '#0689D2',
  44. },
  45. secondary: {
  46. light: '#82d3ba',
  47. main: '#31b78d',
  48. dark: '#279371',
  49. },
  50. error: {
  51. main: '#ff4605',
  52. light: '#ff8f68',
  53. dark: '#cd3804',
  54. },
  55. attuBlue: {
  56. main: '#f8f8fc',
  57. dark: '#dcdce3',
  58. },
  59. attuGrey: {
  60. main: '#aeaebb',
  61. light: '#dcdce3',
  62. dark: '#82838e',
  63. contrastText: '#f8f8fc',
  64. },
  65. attuDark: {
  66. main: '#010e29',
  67. },
  68. },
  69. breakpoints: {
  70. values: {
  71. xs: 0,
  72. sm: 600,
  73. md: 1025,
  74. lg: 1200,
  75. xl: 1920,
  76. },
  77. },
  78. spacing: (factor: number) => `${8 * factor}px`,
  79. };
  80. export const theme = createMuiTheme({
  81. ...commonThemes,
  82. overrides: {
  83. MuiTypography: {
  84. button: {
  85. textTransform: 'initial',
  86. lineHeight: '16px',
  87. fontWeight: 'bold',
  88. },
  89. h1: {
  90. fontSize: '36px',
  91. lineHeight: '42px',
  92. fontWeight: 'bold',
  93. letterSpacing: '-0.02em',
  94. },
  95. h2: {
  96. lineHeight: '24px',
  97. fontSize: '28px',
  98. fontWeight: 'bold',
  99. },
  100. h3: {
  101. lineHeight: '20px',
  102. fontSize: '24px',
  103. fontWeight: 'bold',
  104. },
  105. h4: {
  106. fontWeight: 500,
  107. lineHeight: '23px',
  108. fontSize: '20px',
  109. letterSpacing: '-0.02em',
  110. },
  111. h5: {
  112. fontWeight: 'bold',
  113. fontSize: '16px',
  114. lineHeight: '24px',
  115. },
  116. h6: {
  117. fontWeight: 'normal',
  118. fontSize: '16px',
  119. lineHeight: '24px',
  120. letterSpacing: '-0.01em',
  121. },
  122. // style for element p
  123. body1: {
  124. fontSize: '14px',
  125. lineHeight: '20px',
  126. },
  127. // small caption
  128. body2: {
  129. fontSize: '12px',
  130. lineHeight: '16px',
  131. },
  132. // tiny caption
  133. caption: {
  134. fontSize: '10px',
  135. lineHeight: '12px',
  136. },
  137. },
  138. MuiButton: {
  139. root: {
  140. textTransform: 'initial',
  141. fontWeight: 'bold',
  142. },
  143. text: {
  144. '&:hover': {
  145. backgroundColor: commonThemes.palette.primary.light,
  146. },
  147. },
  148. },
  149. MuiDialogActions: {
  150. spacing: {
  151. padding: commonThemes.spacing(4),
  152. },
  153. },
  154. MuiDialogContent: {
  155. root: {
  156. padding: `${commonThemes.spacing(1)} ${commonThemes.spacing(4)}`,
  157. },
  158. },
  159. MuiDialogTitle: {
  160. root: {
  161. padding: commonThemes.spacing(4),
  162. paddingBottom: commonThemes.spacing(1),
  163. },
  164. },
  165. MuiFormHelperText: {
  166. contained: {
  167. marginLeft: 0,
  168. },
  169. },
  170. MuiFilledInput: {
  171. root: {
  172. backgroundColor: '#f9f9f9',
  173. '&:hover': {
  174. backgroundColor: '#f9f9f9',
  175. },
  176. },
  177. },
  178. // Date time picker theme overrides
  179. MuiPickersToolbar: {
  180. toolbar: {
  181. '& .MuiTypography-h3': {
  182. fontSize: '3rem',
  183. lineHeight: 1.04,
  184. },
  185. '& .MuiTypography-h4': {
  186. fontSize: '1.5rem',
  187. lineHeight: 1.17,
  188. },
  189. },
  190. },
  191. MuiPickerDTTabs: {
  192. tabs: {
  193. backgroundColor: '#fff',
  194. '& .MuiTabs-indicator': {
  195. backgroundColor: commonThemes.palette.primary.main,
  196. },
  197. },
  198. },
  199. MuiPickersCalendarHeader: {
  200. switchHeader: {
  201. '& .MuiTypography-body1': {
  202. fontSize: '0.85rem',
  203. },
  204. },
  205. daysHeader: {
  206. '& .MuiTypography-caption': {
  207. fontSize: '0.85rem',
  208. },
  209. },
  210. },
  211. MuiPickersDay: {
  212. day: {
  213. '& .MuiTypography-body2': {
  214. fontSize: '0.85rem',
  215. },
  216. },
  217. daySelected: {
  218. backgroundColor: commonThemes.palette.primary.main,
  219. color: '#fff',
  220. },
  221. dayDisabled: {},
  222. current: {},
  223. },
  224. MuiPickersModal: {
  225. dialogAction: {
  226. color: commonThemes.palette.primary.main,
  227. },
  228. },
  229. },
  230. });