Skip to content

Commit

Permalink
tweak menu theme
Browse files Browse the repository at this point in the history
  • Loading branch information
hzrd149 committed Oct 6, 2023
1 parent 4dd8d0f commit 88929a8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/theme/default/components/drawer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { drawerAnatomy as parts } from "@chakra-ui/anatomy";
import { createMultiStyleConfigHelpers, cssVar, defineStyle } from "@chakra-ui/styled-system";
import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/styled-system";

const { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(parts.keys);

Expand Down
23 changes: 23 additions & 0 deletions src/theme/default/components/menu.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { menuAnatomy as parts } from "@chakra-ui/anatomy";
import { createMultiStyleConfigHelpers, cssVar, defineStyle } from "@chakra-ui/styled-system";

// https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/theme/src/components/menu.ts

const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(parts.keys);

const $bg = cssVar("menu-bg");

const baseStyleList = defineStyle({
[$bg.variable]: "#fff",
_dark: {
[$bg.variable]: "colors.gray.800",
},
});

const baseStyle = definePartsStyle({
list: baseStyleList,
});

export const menuTheme = defineMultiStyleConfig({
baseStyle,
});
2 changes: 2 additions & 0 deletions src/theme/default/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { pallet } from "../helpers";
import { buttonTheme } from "./components/button";
import { drawerTheme } from "./components/drawer";
import { modalTheme } from "./components/modal";
import { menuTheme } from "./components/menu";

const defaultTheme = extendTheme({
colors: {
Expand All @@ -16,6 +17,7 @@ const defaultTheme = extendTheme({
Button: buttonTheme,
Drawer: drawerTheme,
Modal: modalTheme,
Menu: menuTheme,
},
semanticTokens: {
colors: {
Expand Down

0 comments on commit 88929a8

Please sign in to comment.