Skip to content

Commit

Permalink
fix(Menu): dark theme fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LexSwed committed Oct 3, 2020
1 parent 36321dc commit f78b958
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const Item = styled(Inline, {
'cursor': 'pointer',
'br': '$sm',
'outline': 'none',
'color': '$text',

':hover': {
bc: '$surfaceHover',
Expand Down
5 changes: 4 additions & 1 deletion src/lib/theme/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const swatches: Array<readonly [string, Swatch]> = Object.entries(palette)
name,
{
colors: {
$text: palette.gray['$gray900'],
$primaryStill: colors[`$${name}500` as keyof typeof colors],
$primaryHover: colors[`$${name}600` as keyof typeof colors],
$primaryActive: colors[`$${name}700` as keyof typeof colors],
Expand All @@ -27,13 +28,14 @@ const swatches: Array<readonly [string, Swatch]> = Object.entries(palette)
'black',
{
colors: {
$text: '#fff',
$primaryStill: colors['$gray800'],
$primaryHover: colors['$gray900'],
$primaryActive: 'black',
$primaryLight: colors['$gray100'],
$primaryLightActive: colors['$gray200'],

$surfaceStill: colors['$gray800'],
$surfaceStill: colors['$gray900'],
$surfaceHover: colors['$gray700'],
$surfaceActive: colors['$gray600'],
},
Expand All @@ -49,6 +51,7 @@ type Themes = { [Shade in keyof typeof palette]: string };

type Swatch = {
colors: {
$text: string;
$primaryStill: string;
$primaryHover: string;
$primaryActive: string;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/Menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ For big lists use `action` prop on `Menu.Item` and `onAction` callback to handle
You can modify `offset` and [`placement`](https://popper.js.org/docs/v2/constructors/#options) of the dropdown menu.

<Playground>
<ThemeProvider theme="teal">
<ThemeProvider theme="black">
<Box css={{ p: '$8' }}>
<Menu onAction={typeof window !== 'undefined' ? window.alert : null}>
<Menu.Button>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"jsx": "preserve",
"baseUrl": ".",
"paths": {
"@fxtrot/ui": ["build"]
"@fxtrot/ui": ["src/lib"]
}
},
"include": ["next-env.d.ts", "src/**/*"],
Expand Down

0 comments on commit f78b958

Please sign in to comment.