From 75cf474e7eb6e4d55842abcbd6823e7421ccf961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Zaninotto?= Date: Mon, 24 Feb 2025 17:36:07 +0100 Subject: [PATCH] [demo] Fix submenu collapsed padding in bw theme --- examples/demo/src/layout/SubMenu.tsx | 1 + examples/demo/src/themes/themes.tsx | 31 +++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/examples/demo/src/layout/SubMenu.tsx b/examples/demo/src/layout/SubMenu.tsx index 86442c66dbc..bcfbd5475eb 100644 --- a/examples/demo/src/layout/SubMenu.tsx +++ b/examples/demo/src/layout/SubMenu.tsx @@ -51,6 +51,7 @@ const SubMenu = (props: Props) => { dense={dense} component="div" disablePadding + className="SubMenu" sx={{ '& .MuiMenuItem-root': { transition: diff --git a/examples/demo/src/themes/themes.tsx b/examples/demo/src/themes/themes.tsx index 8edd98434ed..028491dc6bc 100644 --- a/examples/demo/src/themes/themes.tsx +++ b/examples/demo/src/themes/themes.tsx @@ -30,10 +30,39 @@ export interface Theme { dark?: RaThemeOptions; } +const BW_SIDEBAR_OVERRIDE = { + styleOverrides: { + root: { + '& .SubMenu .MuiMenuItem-root': { + paddingLeft: 24, + }, + '& .RaMenu-closed .SubMenu .MuiMenuItem-root': { + paddingLeft: 8, + }, + }, + }, +}; + export const themes: Theme[] = [ { name: 'soft', light: softLightTheme, dark: softDarkTheme }, { name: 'default', light: defaultLightTheme, dark: defaultDarkTheme }, - { name: 'B&W', light: bwLightTheme, dark: bwDarkTheme }, + { + name: 'B&W', + light: { + ...bwLightTheme, + components: { + ...bwLightTheme.components, + RaSidebar: BW_SIDEBAR_OVERRIDE, + }, + }, + dark: { + ...bwDarkTheme, + components: { + ...bwDarkTheme.components, + RaSidebar: BW_SIDEBAR_OVERRIDE, + }, + }, + }, { name: 'nano', light: nanoLightTheme, dark: nanoDarkTheme }, { name: 'radiant', light: radiantLightTheme, dark: radiantDarkTheme }, { name: 'house', light: houseLightTheme, dark: houseDarkTheme },