Skip to content

Commit

Permalink
🚧 [#584] Try chromatic modes
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Dec 27, 2023
1 parent afa4839 commit 7de3749
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .storybook/modes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const allModes = {
mobile: {
viewport: "small",
},
desktop: {
viewport: "large",
}
};
13 changes: 13 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
withClearSubmissionLocalStorage,
} from './decorators';
import {reactIntl} from './reactIntl.js';
import {allModes} from "./modes";

initialize({
onUnhandledRequest: 'bypass',
Expand Down Expand Up @@ -54,6 +55,12 @@ export default {
},
parameters: {
actions: {argTypesRegex: '^on[A-Z].*'},
viewport: {
viewports: {
small: { name: "Small", styles: { width: "640px", height: "800px" } },
large: { name: "Large", styles: { width: "1024px", height: "1000px" } },
},
},
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down Expand Up @@ -85,6 +92,12 @@ export default {
],
},
},
chromatic: {
modes: {
mobile: allModes.mobile,
desktop: allModes.desktop
}
}
},
loaders: [mswLoader],
};

0 comments on commit 7de3749

Please sign in to comment.