chromatic preferred theme is stacked, not side-by-side

This commit is contained in:
Norbert de Langen 2024-07-30 19:47:34 +02:00
parent 8ff2ebad49
commit c9a237679d
5 changed files with 4 additions and 4 deletions

View File

@ -119,8 +119,8 @@ const config: StorybookConfig = {
},
features: {
viewportStoryGlobals: true,
themesStoryGlobals: true,
backgroundsStoryGlobals: true,
// themesStoryGlobals: true,
},
viteFinal: (viteConfig, { configType }) =>
mergeConfig(viteConfig, {

View File

@ -177,7 +177,7 @@ export const decorators = [
theme = 'light';
showPlayFnNotice = true;
} else if (isChromatic() && !storyGlobals.theme && !playFunction) {
theme = 'side-by-side';
theme = 'stacked';
}
switch (theme) {

View File

@ -17,7 +17,6 @@ export const BackgroundTool = memo(function BackgroundSelector() {
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
const { options = emptyBackgroundMap, disable = true } = config || {};
if (disable) {
return null;
}

View File

@ -37,4 +37,5 @@ export const parameters = {
const modern: Record<string, GlobalState> = {
[KEY]: { value: undefined, grid: false },
};
export const initialGlobals = FEATURES?.backgroundsStoryGlobals ? modern : { [KEY]: null };

View File

@ -2,7 +2,7 @@ import { PARAM_KEY as KEY } from './constants';
import type { GlobalState } from './types';
const modern: Record<string, GlobalState> = {
[KEY]: { value: 'reset', isRotated: false },
[KEY]: { value: undefined, isRotated: false },
};
// TODO: remove in 9.0