mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Set up modes for Chromatic (#37586)
This commit is contained in:
2
.github/workflows/chromatic.yml
vendored
2
.github/workflows/chromatic.yml
vendored
@@ -58,5 +58,5 @@ jobs:
|
|||||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||||
zip: true
|
zip: true
|
||||||
storybookBuildDir: 'storybook-static'
|
storybookBuildDir: 'storybook-static'
|
||||||
exitZeroOnChanges: false # Fail workflow if changes are found
|
exitOnceUploaded: true # Exit immediately after upload
|
||||||
autoAcceptChanges: 'main' # Auto-accept changes on main branch only
|
autoAcceptChanges: 'main' # Auto-accept changes on main branch only
|
||||||
|
|||||||
8
.storybook/modes.ts
Normal file
8
.storybook/modes.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const modes = {
|
||||||
|
darkTheme: {
|
||||||
|
theme: 'dark',
|
||||||
|
},
|
||||||
|
lightTheme: {
|
||||||
|
theme: 'light',
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
@@ -25,6 +25,7 @@ import { mockHandlers, unhandledRequestHandler } from '@/testing/api';
|
|||||||
// you can change the below to `/application.scss`
|
// you can change the below to `/application.scss`
|
||||||
import '../app/javascript/styles/mastodon-light.scss';
|
import '../app/javascript/styles/mastodon-light.scss';
|
||||||
import './styles.css';
|
import './styles.css';
|
||||||
|
import { modes } from './modes';
|
||||||
|
|
||||||
const localeFiles = import.meta.glob('@/mastodon/locales/*.json', {
|
const localeFiles = import.meta.glob('@/mastodon/locales/*.json', {
|
||||||
query: { as: 'json' },
|
query: { as: 'json' },
|
||||||
@@ -198,6 +199,13 @@ const preview: Preview = {
|
|||||||
msw: {
|
msw: {
|
||||||
handlers: mockHandlers,
|
handlers: mockHandlers,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
chromatic: {
|
||||||
|
modes: {
|
||||||
|
dark: modes.darkTheme,
|
||||||
|
light: modes.lightTheme,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user