Skip to content

Commit b62d1bd

Browse files
Improve color mapping and add shadows.ts
1 parent d15967b commit b62d1bd

File tree

2 files changed

+69
-24
lines changed

2 files changed

+69
-24
lines changed

src/lib/shadows.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export const shadowsOption = [
2+
"none",
3+
/** Light / SM */
4+
"0px 2px 6px 0px rgba(0,0,18,0.16)",
5+
/** Light / MD */
6+
"0px 4px 12px 0px rgba(0,0,18,0.16)",
7+
/** Light / LG */
8+
"0px 6px 18px 0px rgba(0,0,18,0.16)",
9+
/** Dark / SM */
10+
"0px 2px 6px 0px rgba(0,0,18,0.32)",
11+
/** Dark / MD */
12+
"0px 4px 12px 0px rgba(0,0,18,0.32)",
13+
/** Dark / LG */
14+
"0px 4px 18px 0px rgba(0,0,18,0.32)"
15+
] as const;
16+
17+
// Shadows decisions (shadow applied to an usecase or a context)
18+
19+
/** Raised */
20+
// Use Light or Dark / SM
21+
22+
/** Overlap */
23+
// Use Light or Dark / MD
24+
25+
/** Lifted */
26+
// Use Light or Dark / LG

src/mui.tsx

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,18 @@ function createMuiDsfrTheme(params: { isDark: boolean }): MuiTheme {
3636
"contrastText": options.blueFrance._975sun113.default
3737
},
3838
"secondary": {
39-
"main": options.redMarianne.main472.default,
40-
"light": options.redMarianne._850_200.default,
41-
"dark": options.redMarianne._425_625.default,
42-
"contrastText": options.redMarianne._975_75.default
39+
"main": options.blueFrance._950_100.default,
40+
"light": options.blueFrance._950_100.active,
41+
"dark": options.blueFrance._950_100.hover,
42+
"contrastText": options.blueFrance.sun113_625.default
43+
/*
44+
"main": options.blueFrance._850_200.default,
45+
"light": options.blueFrance._850_200.active,
46+
"dark": options.blueFrance._850_200.hover,
47+
"contrastText": options.blueFrance.sun113_625.default,
48+
*/
4349
},
50+
4451
"error": {
4552
"light": options.error._425_625.active,
4653
"main": options.error._425_625.default,
@@ -73,11 +80,11 @@ function createMuiDsfrTheme(params: { isDark: boolean }): MuiTheme {
7380
},
7481
"divider": options.grey._900_175.default,
7582
"action": {
76-
"default": options.blueFrance.sun113_625.default,
83+
"default": options.grey._200_850.default,
7784
"background": options.blueFrance._925_125.default,
78-
"active": options.blueFrance.sun113_625.active,
85+
"active": options.grey._200_850.default,
7986
"hover": options.grey._975_100.default,
80-
"selected": options.blueFrance._925_125.default,
87+
"selected": options.blueFrance._925_125.active,
8188
"disabled": options.grey._625_425.default,
8289
"disabledBackground": options.grey._925_125.default,
8390
"focus": options.blueFrance.sun113_625.active
@@ -87,6 +94,9 @@ function createMuiDsfrTheme(params: { isDark: boolean }): MuiTheme {
8794
"default": options.grey._1000_50.default,
8895
"paper": options.grey._1000_100.default,
8996
"paperHover": options.grey._975_75.hover
97+
},
98+
"getContrastText": () => {
99+
return "cyan";
90100
}
91101
} as const;
92102
})(),
@@ -184,20 +194,29 @@ export function noAugmentation(params: { nonAugmentedMuiTheme: MuiTheme }) {
184194
return nonAugmentedMuiTheme;
185195
}
186196

187-
//const shadows = [
188-
// "none",
189-
/** ButtonBar shadow */
190-
// "0px 6px 10px 0px rgba(0,0,0,0.07)",
191-
/** Explorer items */
192-
// "0px 4px 4px 0px rgba(0,0,0,0.1)",
193-
/** LeftBar */
194-
// "6px 0px 16px 0px rgba(0,0,0,0.15)",
195-
/** AccountTab default */
196-
// "4px 0px 10px 0px rgba(0,0,0,0.07)",
197-
/** AccountTab active */
198-
// "-4px 0px 10px 0px rgba(0,0,0,0.07)",
199-
/** Card over */
200-
// "0px 6px 10px 0px rgba(0,0,0,0.14)",
201-
/** Dialog **/
202-
// "0px 8px 10px -7px rgba(0,0,0,0.07)",
203-
//] as const;
197+
// export const shadowsOption = [
198+
// "none",
199+
/* Light / SM */
200+
// "0px 2px 6px 0px rgba(0,0,18,0.16)",
201+
/* Light / MD */
202+
// "0px 4px 12px 0px rgba(0,0,18,0.16)",
203+
/* Light / LG */
204+
// "0px 6px 18px 0px rgba(0,0,18,0.16)",
205+
/* Dark / SM */
206+
// "0px 2px 6px 0px rgba(0,0,18,0.32)",
207+
/* Dark / MD */
208+
// "0px 4px 12px 0px rgba(0,0,18,0.32)",
209+
/* Dark / LG */
210+
// "0px 4px 18px 0px rgba(0,0,18,0.32)",
211+
// ] as const;
212+
213+
// Shadows decisions (shadow applied to an usecase or a context)
214+
215+
/** Raised */
216+
// Use Light or Dark / SM
217+
218+
/** Overlap */
219+
// Use Light or Dark / MD
220+
221+
/** Lifted */
222+
// Use Light or Dark / LG

0 commit comments

Comments
 (0)