new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Storybook · Setup · all subjects

styling & assets

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Set global iframe height in preview.js

To update the global default iframe height, modify .storybook/preview.js with: export const parameters = { docs: { story: { iframeHeight: '400px' } } };

Default iframe height for Ember stories

Storybook Docs renders Ember stories inside iframes with a default height of 60px.

Set global iframe height for Ember docs

To update the default iframe height globally for Ember stories in DocsPage, modify .storybook/preview.js: export const parameters = { docs: { story: { iframeHeight: '400px' } } };

Set iframe height per story in DocsPage

To modify the iframe height locally for a single story in DocsPage, set the story parameters: export const basic = () => ... basic.parameters = { docs: { story: { iframeHeight: '400px' } } }

Set iframe height in MDX Story element

To modify the iframe height for an MDX story, use the height attribute on the Story element: <Story name='basic' height='400px'>{...}</Story>

sassOptions not supported in Vite-based Next.js integration

The sassOptions property in next.config.js is not supported in the Vite-based integration. Instead, use Vite's configuration options to configure the Sass compiler via css.preprocessorOptions.scss in vite.config.ts.

Mocking imports in Storybook using sb.mock

To mock imports in Storybook, register module mocks in `.storybook/preview.ts` using the `sb.mock()` function from 'storybook/test'. Use spy mocks to keep functions while allowing override and spying: `sb.mock(import('some-library'), { spy: true })`. When referring to relative files, use file extensions: `sb.mock(import('./relative/module.ts'), { spy: true })`

Overriding mock values per story

Override mock behavior per-story using `beforeEach` and the `mocked()` type function imported from 'storybook/test'. Example: `beforeEach: async () => { mocked(library).mockResolvedValue({ user: 'data' }); }`. Ensure the import is mocked in the preview file first.

Give your agent this brain