Skip to content

Commit 265f98b

Browse files
authored
Merge pull request #13 from ikoamu/menu-style
feat: Update menu item styles in _app.tsx
2 parents 28a1de0 + 22d0410 commit 265f98b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

pages/_app.tsx

+19-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ import * as d3int from 'd3-interpolate'
77
import { ThemeContext } from '../util/themecontext'
88
import { usePersistantState } from '../util/persistant-state'
99
import { themes } from '../components/themes'
10+
import { createMultiStyleConfigHelpers } from '@chakra-ui/styled-system'
11+
12+
const helpers = createMultiStyleConfigHelpers(['menu', 'item'])
13+
const Menu = helpers.defineMultiStyleConfig({
14+
baseStyle: {
15+
item: {
16+
backgroundColor: 'white',
17+
"_focus": {
18+
backgroundColor: 'gray.200',
19+
},
20+
_hover: {
21+
backgroundColor: 'gray.200',
22+
},
23+
},
24+
},
25+
})
1026

1127
function MyApp({ Component, pageProps }: AppProps) {
1228
type Theme = [string, { [color: string]: string }]
@@ -31,11 +47,11 @@ function MyApp({ Component, pageProps }: AppProps) {
3147
useEffect(() => {
3248
setEmacsTheme(
3349
JSON.parse(localStorage.getItem('colorTheme') ?? JSON.stringify(initialTheme)) ??
34-
initialTheme,
50+
initialTheme,
3551
)
3652
setHighlightColor(
3753
JSON.parse(localStorage.getItem('highlightColor') ?? JSON.stringify(highlightColor)) ??
38-
highlightColor,
54+
highlightColor,
3955
)
4056
setIsInitialized(true)
4157
}, [])
@@ -190,6 +206,7 @@ function SubApp(props: any) {
190206
},
191207
}),
192208
},
209+
Menu,
193210
},
194211
}
195212
}, [highlightColor, JSON.stringify(emacsTheme)])

0 commit comments

Comments
 (0)