mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 02:33:09 +02:00
build(#10336): isChromatic
This commit is contained in:
parent
388ecfb1ea
commit
faf827a50a
3 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
import { addons } from '@storybook/addons';
|
import { addons } from '@storybook/addons';
|
||||||
import { FORCE_REMOUNT } from '@storybook/core-events';
|
import { FORCE_REMOUNT } from '@storybook/core-events';
|
||||||
import { type Preview, setup } from '@storybook/vue3';
|
import { type Preview, setup } from '@storybook/vue3';
|
||||||
|
import isChromatic from 'chromatic/isChromatic';
|
||||||
import { initialize, mswDecorator } from 'msw-storybook-addon';
|
import { initialize, mswDecorator } from 'msw-storybook-addon';
|
||||||
import locale from './locale';
|
import locale from './locale';
|
||||||
import { commonHandlers, onUnhandledRequest } from './mocks';
|
import { commonHandlers, onUnhandledRequest } from './mocks';
|
||||||
|
@ -18,6 +19,8 @@ function loadTheme(applyTheme: typeof import('../src/scripts/theme')['applyTheme
|
||||||
const theme = themes[document.documentElement.dataset.misskeyTheme];
|
const theme = themes[document.documentElement.dataset.misskeyTheme];
|
||||||
if (theme) {
|
if (theme) {
|
||||||
applyTheme(themes[document.documentElement.dataset.misskeyTheme]);
|
applyTheme(themes[document.documentElement.dataset.misskeyTheme]);
|
||||||
|
} else if (isChromatic()) {
|
||||||
|
applyTheme(themes['l-light']);
|
||||||
}
|
}
|
||||||
const observer = new MutationObserver((entries) => {
|
const observer = new MutationObserver((entries) => {
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ export const Default = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
static: isChromatic,
|
static: isChromatic(),
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
|
|
|
@ -24,7 +24,7 @@ export const Default = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
static: isChromatic,
|
static: isChromatic(),
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
|
|
Loading…
Reference in a new issue