Skip to content

Commit

Permalink
🎨 clean up devto styles n stories (#13)
Browse files Browse the repository at this point in the history
* 🔥 turn off chromatic modes

* ⬆️ update dependencies and fixtures
  • Loading branch information
scottnath authored Oct 18, 2023
1 parent debf421 commit bfae852
Show file tree
Hide file tree
Showing 19 changed files with 362 additions and 206 deletions.
13 changes: 12 additions & 1 deletion .storybook/modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,15 @@ export const allModes = {
theme: 'light',
viewport: 'small',
},
};
};

export const basicModes = {
dark: {
backgrounds: 'dark',
theme: 'dark',
},
light: {
backgrounds: 'light',
theme: 'light',
},
}
20 changes: 14 additions & 6 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ import { setCustomElementsManifest } from '@storybook/web-components';
import customElements from '../custom-elements.json';
import { globalTypesPrimer, decoratorsPrimer } from './primer-preview';
import { viewports } from './viewports';
import { defaultModes } from './modes';
import "./storybook.css";

setCustomElementsManifest(customElements);

export const globalTypes = globalTypesPrimer;
export const decorators = decoratorsPrimer;

global.attrGen = (args) => Object.entries(args)
.filter(([key, value]) => value)
.map(([key, value]) => `\n ${key}="${value}"`)
.join(' ');

global.stringify = (obj) => JSON.stringify(obj).replace(/"/g, """)

/** @type { import('@storybook/web-components').Preview } */
const preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
chromatic: {
modes: {
...defaultModes,
},
},
controls: {
expanded: true,
matchers: {
Expand All @@ -30,6 +31,13 @@ const preview = {
viewport: {
viewports,
},
docs: {
source: {
transform: (code) => {
return code.replaceAll('&gt;', ">").replaceAll('&lt;', "<")
}
}
}
},
};

Expand Down
7 changes: 7 additions & 0 deletions .storybook/viewports.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export const customViewports = {
height: '100%',
},
},
containerMin4: {
name: 'ContainerMin4: 600px',
styles: {
width: '600px',
height: '100%',
},
},
};

export const viewports ={
Expand Down
Loading

0 comments on commit bfae852

Please sign in to comment.