Skip to content

Commit e381e0d

Browse files
committed
add shadow
1 parent 9d10949 commit e381e0d

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

src/mui.tsx

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import type { ColorTheme } from "./lib/colors";
1212
import type { Theme as NonAugmentedMuiTheme } from "./lib/tools/@mui/material/styles/createTheme";
1313
import { assert } from "tsafe/assert";
1414
import { objectKeys } from "tsafe/objectKeys";
15+
import defaultMuiShadows from "@mui/material/styles/shadows";
16+
import type { Shadows } from "@mui/material/styles";
17+
import { id } from "tsafe/id";
1518

1619
function createMuiDsfrTheme(params: { isDark: boolean }): MuiTheme {
1720
const { isDark } = params;
@@ -139,8 +142,29 @@ function createMuiDsfrTheme(params: { isDark: boolean }): MuiTheme {
139142
const value = values[abs - 1];
140143
return value === undefined ? abs : value;
141144
})();
145+
})(),
146+
"shadows": (() => {
147+
const [, , , , , , , , ...rest] = defaultMuiShadows;
148+
149+
return id<Shadows>([
150+
"none",
151+
/** ButtonBar shadow */
152+
"0px 6px 10px 0px rgba(0,0,0,0.07)",
153+
/** Explorer items */
154+
"0px 4px 4px 0px rgba(0,0,0,0.1)",
155+
/** LeftBar */
156+
"6px 0px 16px 0px rgba(0,0,0,0.15)",
157+
/** AccountTab default */
158+
"4px 0px 10px 0px rgba(0,0,0,0.07)",
159+
/** AccountTab active */
160+
"-4px 0px 10px 0px rgba(0,0,0,0.07)",
161+
/** Card over */
162+
"0px 6px 10px 0px rgba(0,0,0,0.14)",
163+
/** Dialog **/
164+
"0px 8px 10px -7px rgba(0,0,0,0.07)",
165+
...rest
166+
]);
142167
})()
143-
//shadows
144168
});
145169

146170
return muiTheme;
@@ -183,21 +207,3 @@ export function noAugmentation(params: { nonAugmentedMuiTheme: MuiTheme }) {
183207
const { nonAugmentedMuiTheme } = params;
184208
return nonAugmentedMuiTheme;
185209
}
186-
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;

0 commit comments

Comments
 (0)