-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extend dark mode to entire Storybook UI
- Loading branch information
Showing
10 changed files
with
155 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<style> | ||
body { | ||
color: var(--colors-on-background) !important; | ||
} | ||
|
||
/* === LEFT SIDEBAR === */ | ||
#storybook-explorer-tree .sidebar-item { | ||
color: var(--colors-on-background) !important; | ||
} | ||
|
||
#storybook-explorer-tree .sidebar-item[data-selected='true'] { | ||
background: var(--colors-support) !important; | ||
color: var(--colors-on-support) !important; | ||
} | ||
|
||
nav.sidebar-container { | ||
background: var(--colors-background) !important; | ||
} | ||
|
||
nav.sidebar-container input { | ||
color: var(--colors-on-background) !important; | ||
} | ||
|
||
nav.sidebar-container [role='combobox'] svg { | ||
stroke: var(--colors-on-background) !important; | ||
} | ||
|
||
nav.sidebar-container ol[role='listbox'] mark { | ||
color: var(--colors-main) !important; | ||
} | ||
|
||
nav.sidebar-container .sidebar-subheading { | ||
color: var(--colors-on-background) !important; | ||
} | ||
|
||
|
||
/* === TOP STICKY BAR === */ | ||
.sb-bar { | ||
background: var(--colors-background) !important; | ||
color: var(--colors-on-background) !important; | ||
} | ||
|
||
.sb-bar button { | ||
background-color: var(--colors-surface-inverse) !important; | ||
color: var(--colors-on-surface-inverse) !important; | ||
} | ||
|
||
|
||
/* === THEME PICKER WIDGET (INSIDE TOP STICKY BAR) === */ | ||
[data-testid='tooltip'] { | ||
background-color: var(--colors-surface-inverse) !important; | ||
color: var(--colors-on-surface-inverse) !important; | ||
} | ||
|
||
[data-testid='tooltip'] span { | ||
color: var(--colors-on-surface-inverse) !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,17 @@ | ||
import { create } from '@storybook/theming/create' | ||
import logoUrl from '../spark-logo.svg' | ||
import { create } from "@storybook/theming/create"; | ||
import logoUrl from "../spark-logo.svg"; | ||
|
||
// https://github.com/storybookjs/storybook/blob/next/code/lib/theming/src/types.ts | ||
export const getTheme = ({ base, sparkTheme }) => | ||
create({ | ||
export const getTheme = ({ base }) => { | ||
return create({ | ||
base, | ||
// Brand | ||
colorPrimary: sparkTheme.colors.main, | ||
colorSecondary: sparkTheme.colors.support, | ||
|
||
// UI | ||
appBg: sparkTheme.colors.backgroundVariant, | ||
appContentBg: sparkTheme.colors.background, | ||
// appPreviewBg: TODO | ||
appBorderColor: sparkTheme.colors.basicContainer, | ||
appBorderRadius: sparkTheme.borderRadius.lg, | ||
|
||
// Typography | ||
fontBase: '"Nunito", sans-serif', | ||
fontCode: 'monospace', | ||
|
||
// Text colors | ||
textColor: sparkTheme.colors.onBackground, | ||
textInverseColor: sparkTheme.colors.background, | ||
// textMutedColor: TODO | ||
fontCode: "monospace", | ||
|
||
// Toolbar default and active colors | ||
barTextColor: sparkTheme.colors.onBackground, | ||
barHoverColor: sparkTheme.colors.basicContainerHovered, | ||
barSelectedColor: sparkTheme.colors.basicContainer, | ||
barBg: sparkTheme.colors.backgroundVariant, | ||
|
||
// Form colors | ||
buttonBg: sparkTheme.colors.primary, | ||
buttonBorder: 'transparent', | ||
inputBg: 'transparent', | ||
inputBorder: sparkTheme.colors.basic, | ||
inputTextColor: sparkTheme.colors.basic, | ||
inputBorderRadius: sparkTheme.borderRadius.sm, | ||
|
||
brandTitle: 'Spark design system', | ||
brandUrl: 'https://zeroheight.com/1186e1705/p/0879a9-colors/b/27d7a3', | ||
brandTitle: "Spark design system", | ||
brandUrl: "https://zeroheight.com/1186e1705/p/0879a9-colors/b/27d7a3", | ||
brandImage: logoUrl, | ||
brandTarget: '_self', | ||
|
||
// gridCellSize?: TODO | ||
}) | ||
brandTarget: "_self", | ||
}); | ||
}; |
Oops, something went wrong.