storybook icon indicating copy to clipboard operation
storybook copied to clipboard

[Bug]: Can't get Storybook to work with typescript-plugin-css-modules using SCSS #12464

Open spice2445 opened this issue 1 year ago • 2 comments

Describe the bug

Styles are not loaded into the storybook where style named export is used Example of story:

// index.stories.tsx
import { ComponentStory, ComponentMeta } from '@storybook/react';

import './style.module.scss';

import { Button } from '.';

export default {
  title: 'shared/Button',
  component: Button,
  argTypes: {
    theme: {
      description: 'Вариант цветовой темы для кнопки',
      defaultValue: 'primary',
      options: [
        'primary',
        'transparent_default',
        'white',
        'second',
        'small',
        'small_active',
        'text', 'back',
        'mini_icon',
        'big_icon'
      ],
      control: {
        type: 'radio'
      }
    },
    children: {
      name: 'label',
      control: 'Text',
      description: 'Текст внутри кнопки',
      defaultValue: 'Открыть страницу профиля'
    },
    className: {
      description: 'Дополнительный класс для кнопки'
    },
    icon: {
      description: 'Иконка в кнопке'
    }
  }
} as ComponentMeta<typeof Button>;

const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;

export const Default = Template.bind({});

my main.js file:

module.exports = {
  stories: [
    '../../src/**/*.stories.mdx',
    '../../src/**/*.stories.@(js|jsx|ts|tsx)'
  ],
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    '@storybook/addon-interactions'
  ],
  framework: '@storybook/react',
  core: {
    builder: '@storybook/builder-webpack5'
  }
};

To Reproduce

No response

System

No response

Additional context

No response

spice2445 avatar Dec 13 '23 13:12 spice2445

@Integrayshaun is this something you can help out with?

shilman avatar Dec 24 '23 03:12 shilman

Hey @spice2445 👋

Can you share a repro of your project with me so that I can dig in?

ShaunEvening avatar Jan 02 '24 19:01 ShaunEvening