Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { addons } from 'storybook/manager-api'
import { create } from 'storybook/theming'

const npmxTheme = create({
brandTitle: 'npmx Storybook',
brandImage: '/npmx-storybook.svg',
})
import npmxDark from './theme'

addons.setConfig({
theme: npmxTheme,
theme: npmxDark,
})
6 changes: 6 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<style>
/* Override docs story canvas background to match npmx theme */
.docs-story {
background-color: var(--bg, oklch(0.171 0 0)) !important;
}
</style>
5 changes: 5 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { currentLocales } from '../config/i18n'
import { fn } from 'storybook/test'
import { ACCENT_COLORS } from '../shared/utils/constants'

import npmxDark from './theme'

// related: https://github.com/npmx-dev/npmx.dev/blob/1431d24be555bca5e1ae6264434d49ca15173c43/test/nuxt/setup.ts#L12-L26
// Stub Nuxt specific globals
// @ts-expect-error - dynamic global name
Expand All @@ -25,6 +27,9 @@ const preview: Preview = {
date: /Date$/i,
},
},
docs: {
theme: npmxDark,
},
},
// Provides toolbars to switch things like theming and language
globalTypes: {
Expand Down
13 changes: 13 additions & 0 deletions .storybook/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { create } from 'storybook/theming'

const npmxDark = create({
base: 'dark',

brandTitle: 'npmx Storybook',
brandImage: '/npmx-storybook.svg',

// UI
appContentBg: '#101010', // oklch(0.171 0 0)
})

export default npmxDark
Loading