@@ -14,30 +14,30 @@ import type { Theme as NonAugmentedMuiTheme } from "./lib/tools/@mui/material/st
14
14
15
15
export type { NonAugmentedMuiTheme } ;
16
16
17
- const createMuiDsfrTheme = memoize ( ( isDark : boolean ) : MuiTheme => {
18
-
19
- const muiTheme = createTheme ( {
20
- "shape" : {
21
- "borderRadius" : 0
22
- } ,
23
- "breakpoints" : {
24
- "unit" : breakpointValuesUnit ,
25
- "values" : breakpointValues
26
- } ,
27
- "palette" : ( ( ) => {
28
- const { decisions } = getColors ( isDark ) ;
17
+ const createMuiDsfrTheme = memoize (
18
+ ( isDark : boolean ) : MuiTheme => {
19
+ const muiTheme = createTheme ( {
20
+ "shape" : {
21
+ "borderRadius" : 0
22
+ } ,
23
+ "breakpoints" : {
24
+ "unit" : breakpointValuesUnit ,
25
+ "values" : breakpointValues
26
+ } ,
27
+ "palette" : ( ( ) => {
28
+ const { decisions } = getColors ( isDark ) ;
29
29
30
- return {
31
- "mode" : isDark ? "dark" : "light" ,
32
- "primary" : {
33
- "main" : decisions . background . actionHigh . blueFrance . default ,
34
- "light" : decisions . background . actionLow . blueFrance . default
35
- } ,
36
- "secondary" : {
37
- "main" : decisions . background . actionHigh . redMarianne . default ,
38
- "light" : decisions . background . actionLow . redMarianne . default
39
- }
40
- /*
30
+ return {
31
+ "mode" : isDark ? "dark" : "light" ,
32
+ "primary" : {
33
+ "main" : decisions . background . actionHigh . blueFrance . default ,
34
+ "light" : decisions . background . actionLow . blueFrance . default
35
+ } ,
36
+ "secondary" : {
37
+ "main" : decisions . background . actionHigh . redMarianne . default ,
38
+ "light" : decisions . background . actionLow . redMarianne . default
39
+ }
40
+ /*
41
41
"primary": {
42
42
"900": colorOptions.blueFrance._925_125.default,
43
43
"800": colorOptions.blueFrance._850_200.default,
@@ -47,42 +47,44 @@ const createMuiDsfrTheme = memoize((isDark: boolean): MuiTheme => {
47
47
"light": colorDecisions.background.actionLow.redMarianne.default,
48
48
},
49
49
*/
50
- } as const ;
51
- } ) ( ) ,
52
- "typography" : {
53
- "fontFamily" : '"Marianne", arial, sans-serif' ,
54
- "h1" : typography . find ( ( { selector } ) => selector === "h1" ) ! . style ,
55
- "h2" : typography . find ( ( { selector } ) => selector === "h2" ) ! . style ,
56
- "h3" : typography . find ( ( { selector } ) => selector === "h3" ) ! . style ,
57
- "h4" : typography . find ( ( { selector } ) => selector === "h4" ) ! . style ,
58
- "h5" : typography . find ( ( { selector } ) => selector === "h5" ) ! . style ,
59
- "h6" : typography . find ( ( { selector } ) => selector === "h6" ) ! . style ,
60
- //"subtitle1":
61
- //"subtitle2":
62
- "body1" : typography . find ( ( { selector } ) => selector === "p" ) ! . style
63
- //"body2": {},
64
- //"caption": {},
65
- //"button": {},
66
- //"overline": {}
67
- } ,
68
- "spacing" : ( ( ) => {
69
- //NOTE: The properties are declared sorted in the object.
70
- const values = Object . values ( spacingTokenByValue ) ;
50
+ } as const ;
51
+ } ) ( ) ,
52
+ "typography" : {
53
+ "fontFamily" : '"Marianne", arial, sans-serif' ,
54
+ "h1" : typography . find ( ( { selector } ) => selector === "h1" ) ! . style ,
55
+ "h2" : typography . find ( ( { selector } ) => selector === "h2" ) ! . style ,
56
+ "h3" : typography . find ( ( { selector } ) => selector === "h3" ) ! . style ,
57
+ "h4" : typography . find ( ( { selector } ) => selector === "h4" ) ! . style ,
58
+ "h5" : typography . find ( ( { selector } ) => selector === "h5" ) ! . style ,
59
+ "h6" : typography . find ( ( { selector } ) => selector === "h6" ) ! . style ,
60
+ //"subtitle1":
61
+ //"subtitle2":
62
+ "body1" : typography . find ( ( { selector } ) => selector === "p" ) ! . style
63
+ //"body2": {},
64
+ //"caption": {},
65
+ //"button": {},
66
+ //"overline": {}
67
+ } ,
68
+ "spacing" : ( ( ) => {
69
+ //NOTE: The properties are declared sorted in the object.
70
+ const values = Object . values ( spacingTokenByValue ) ;
71
71
72
- return ( abs : string | number ) =>
73
- typeof abs === "string"
74
- ? abs
75
- : abs === 0
72
+ return ( abs : string | number ) =>
73
+ typeof abs === "string"
74
+ ? abs
75
+ : abs === 0
76
76
? 0
77
77
: ( ( ) => {
78
- const value = values [ abs - 1 ] ;
79
- return value === undefined ? abs : value ;
80
- } ) ( ) ;
81
- } ) ( )
82
- } ) ;
78
+ const value = values [ abs - 1 ] ;
79
+ return value === undefined ? abs : value ;
80
+ } ) ( ) ;
81
+ } ) ( )
82
+ } ) ;
83
83
84
- return muiTheme ;
85
- } , { "max" : 1 } ) ;
84
+ return muiTheme ;
85
+ } ,
86
+ { "max" : 1 }
87
+ ) ;
86
88
87
89
export type MuiDsfrThemeProviderProps = {
88
90
children : ReactNode ;
@@ -153,4 +155,3 @@ export function MuiDsfrThemeProvider(props: MuiDsfrThemeProviderProps) {
153
155
},
154
156
});
155
157
*/
156
-
0 commit comments