Skip to content

Commit

Permalink
Chromatic does not support viewports and modes on the same story, re…
Browse files Browse the repository at this point in the history
…jigged out mobile template snapshots are taken, wip
  • Loading branch information
duttonw committed Apr 15, 2024
1 parent 0b7e3ab commit 143aa14
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 1,106 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ storybook-static/
build-storybook.log
docs/
dist/
.idea
*.iml
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const config = {
],
addons: [//Storybook addons
//https://storybook.js.org/addons/
"@storybook/addon-themes", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-links", "@storybook/addon-mdx-gfm", "@chromatic-com/storybook"],
"@storybook/addon-themes", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-links", "@chromatic-com/storybook"],

framework: {
//Build the storybook with html-vite rendered - faster than webpack
Expand Down
2 changes: 1 addition & 1 deletion .storybook/modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export const allModes = {
mobile: {
viewport: "small",
viewport: "iphone12",
},
desktop: {
viewport: "large",
Expand Down
2 changes: 2 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "../dist/assets/js/qld.bootstrap.min.js";
import "../dist/assets/css/qld.bootstrap.css";
import {withThemeByClassName} from '@storybook/addon-themes';
import {allBackgrounds} from "./modes.js";
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';

/** @type { import('@storybook/html-vite').Preview } */
const preview = {
Expand All @@ -29,6 +30,7 @@ const preview = {
xlarge: {name: "Extra Large", styles: {width: "1312px", height: "1000px"}},
xxlarge: {name: "Extra Extra Large", styles: {width: "1599px", height: "1000px"}},
navbreakpoint: {name: "Nave Breakpoint", styles: {width: "992px", height: "800px"}},
...INITIAL_VIEWPORTS
},
},
hideNoControlsWarning: true,
Expand Down
4 changes: 4 additions & 0 deletions chromatic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"projectId": "Project:660e3e06af8da379e06be302",
"zip": true
}
Loading

0 comments on commit 143aa14

Please sign in to comment.