wingsuit-designsystem / wingsuit

Twig for Storybook
GNU General Public License v2.0
90 stars 16 forks source link

defaultViewport not working in 2.0-beta #285

Open jowan opened 5 months ago

jowan commented 5 months ago

Describe the bug defaultViewport as set in component story not respected.

To Reproduce Steps to reproduce the behavior:

  1. Create a list of custom viewports in preview.jsx
  2. Create a component with its own stories.wingsuit.jsx
  3. Add a default viewport to parameters as described in the add-on's docs (and wingsuit 1x)

Expected behavior When viewing the component - the default viewport is applied

Additional context I spun up a clean version of the Tailwind starter kit 2.0-beta. It has some custom viewports already defined in its preview.jsx. I can not make Storybook apply the default viewport. This worked fine in wingsuit 1x but it's not working now :(

This does raise the question - do parameters work at all ? maybe it is not just viewport, maybe its the parameters object.

For reference, this is what I am doing, and it does not work.


import './index';

const patternDefinition = require('./fieldset.wingsuit.yml');

export const wingsuit = {
  patternDefinition,
  parameters: {
    viewport: {
      defaultViewport: 'sm',
    },
  },
};