File tree Expand file tree Collapse file tree 5 files changed +102
-21
lines changed Expand file tree Collapse file tree 5 files changed +102
-21
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,16 @@ import { StrictMode } from 'react';
22import * as ReactDOM from 'react-dom/client' ;
33import { RouterProvider } from 'react-router-dom' ;
44import { router } from './routes/Routes' ;
5+ import { CssBaseline , ThemeProvider } from '@mui/material' ;
6+ import theme from './theme' ;
57
68const root = ReactDOM . createRoot ( document . getElementById ( 'root' ) as HTMLElement ) ;
79
810root . render (
911 < StrictMode >
10- < RouterProvider router = { router } />
12+ < ThemeProvider theme = { theme } >
13+ < CssBaseline />
14+ < RouterProvider router = { router } />
15+ </ ThemeProvider >
1116 </ StrictMode >
1217) ;
Original file line number Diff line number Diff line change 1- /* You can add global styles to this file, and also import other style files */
1+ :root {
2+ --primary-color : #153d77 ;
3+ --secondary-color : #607d8b ;
4+ --success-color : #198754 ;
5+ --error-color : #ff1744 ;
6+ --white-color : #fff ;
7+ --background-color : #dedede ;
8+ --pdf-color : #f40f02 ;
9+ --word-document-color : #2b579a ;
10+ }
11+
12+
213/* The sidebar menu */
314.sidenav {
415 height : 100% ; /* Full-height: remove this if you want "auto" height */
2334 font-size : 20px ;
2435 display : block ;
2536}
37+
Original file line number Diff line number Diff line change 1+ import { createTheme } from '@mui/material/styles' ;
2+ import { getCssVariable } from './utils/CssUtils' ;
3+
4+ declare module '@mui/material/styles' {
5+ interface BreakpointOverrides {
6+ xs : true ;
7+ sm : true ;
8+ md : true ;
9+ lg : true ;
10+ xl : true ;
11+ xxl : true ;
12+ xxxl : true ;
13+ }
14+ }
15+
16+ // A custom theme for this app
17+ const theme = createTheme ( {
18+ cssVariables : { cssVarPrefix : '' } ,
19+ breakpoints : {
20+ values : {
21+ xs : 0 ,
22+ sm : 600 ,
23+ md : 900 ,
24+ lg : 1200 ,
25+ xl : 1536 ,
26+ xxl : 1920 ,
27+ xxxl : 2200 ,
28+ } ,
29+ } ,
30+ palette : {
31+ primary : {
32+ main : getCssVariable ( '--primary-color' ) ,
33+ } ,
34+ secondary : {
35+ main : getCssVariable ( '--secondary-color' ) ,
36+ } ,
37+ success : {
38+ main : getCssVariable ( '--success-color' ) ,
39+ } ,
40+ error : {
41+ main : getCssVariable ( '--error-color' ) ,
42+ } ,
43+ background : {
44+ default : getCssVariable ( '--background-color' ) ,
45+ } ,
46+ } ,
47+ components : {
48+ // @ts -ignore
49+ MuiDataGrid : {
50+ styleOverrides : {
51+ root : {
52+ '--DataGrid-containerBackground' : '#FFFFFF' ,
53+ } ,
54+ } ,
55+ } ,
56+ } ,
57+ } ) ;
58+
59+ export default theme ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Get the value of a CSS variable
3+ *
4+ * @param variable The name of the CSS variable
5+ *
6+ * @returns The value of the CSS variable
7+ *
8+ * @author Pavan Kumar Jadda
9+ * @since 1.6.0
10+ */
11+ export function getCssVariable ( variable : string ) : string {
12+ return getComputedStyle ( document . documentElement ) . getPropertyValue ( variable ) . trim ( ) ;
13+ }
Original file line number Diff line number Diff line change 11/* Define global variables */
22
3- $primary-color : #153d77 ;
4- $secondary-color : #607d8b ;
5- $success-color : #198754 ;
6- $error-color : #ff1744 ;
7- $white-color : #fff ;
8- $background-color : #dedede ;
9- $pdf-color : #f40f02 ;
10- $word-document-color : #2b579a ;
3+ :root {
4+ --primary-color : #153d77 ;
5+ --secondary-color : #607d8b ;
6+ --success-color : #198754 ;
7+ --error-color : #ff1744 ;
8+ --white-color : #fff ;
9+ --background-color : #dedede ;
10+ --pdf-color : #f40f02 ;
11+ --word-document-color : #2b579a ;
12+ }
13+
1114
12- /* Export the variables so that they can be used in the app */
13- :export {
14- primary Color : $primary-color ;
15- secondary Color : $secondary-color ;
16- success Color : $success-color ;
17- error Color : $error-color ;
18- white Color : $white-color ;
19- background Color : $background-color ;
20- pdf Document Color : $pdf-color ;
21- word Document Color : $word-document-color ;
22- }
You can’t perform that action at this time.
0 commit comments