Skip to content

Commit

Permalink
Paint storybook to dark
Browse files Browse the repository at this point in the history
  • Loading branch information
AyIong committed Jan 5, 2025
1 parent a3df855 commit 4e25688
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .storybook/preview.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@use "sass:color";
@use '../lib/styles/base.scss' as base;
@use '../lib/styles/colors.scss' as colors;

html, body {
scrollbar-color: color.adjust(base.$color-bg, $lightness: 6%) color.adjust(base.$color-bg, $lightness: -4.25%);
background-color: base.$color-bg;
color: colors.$white;
}
8 changes: 8 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Preview } from '@storybook/react';
import previewTheme from './previewTheme.ts';
import '../stories/assets/fonts.css';
import '../stories/assets/all.min.css';
import { withConsole } from '@storybook/addon-console';
Expand All @@ -12,6 +13,13 @@ const preview: Preview = {
date: /Date$/i,
},
},
backgrounds: {
default: 'Section',
values: [{ name: 'Section', value: 'rgba(0, 0, 0, 0.33)' }],
},
docs: {
theme: previewTheme,
},
},
decorators: [(storyFn, context) => withConsole()(storyFn)(context)],
tags: ['autodocs'],
Expand Down
12 changes: 12 additions & 0 deletions .storybook/previewTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { create } from '@storybook/theming/create';
import './preview.scss';

export default create({
base: 'dark',
brandTitle: 'TGUI-core',
brandUrl: 'https://github.com/tgstation/tgui-core',

appBg: 'hsl(0, 0%, 14%)',
appContentBg: 'hsl(0, 0%, 14%)',
appPreviewBg: 'hsl(0, 0%, 14%)',
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@storybook/blocks": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-vite": "^8.4.7",
"@storybook/theming": "^8.4.7",
"@storybook/test": "^8.4.7",
"@types/node": "^22.9.0",
"@types/react": "^18.3.3",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e25688

Please sign in to comment.