Have ideas to improve npm?Join in the discussion! »

    storybook-preset-less
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.2 • Public • Published

    Less preset for Storybook

    NPM version

    One-line Less configuration for Storybook.

    Based on @storybook/preset-scss.

    Basic usage

    npm install --save-dev storybook-preset-less css-loader less less-loader style-loader
    

    Then add the following to .storybook/main.js:

    module.exports = {
      addons: ['storybook-preset-less'],
    };

    Advanced usage

    You can pass configurations by using Object addon declaration for storybook-preset-less and adding the configurations under the option key. You can pass configurations into the preset's webpack loaders using styleLoaderOptions, cssLoaderOptions, and lessLoaderOptions keys. See documentation for each respective loader to learn about valid options. You can register other addons through the string declaration as normal.

    module.exports = {
      addons: [
        {
          name: 'storybook-preset-les',
          options: {
            cssLoaderOptions: {
               modules: true,
               localIdentName: '[name]__[local]--[hash:base64:5]',
            },
            lessLoaderOptions: {
              lessOptions: {
                strictMath: false,
                noIeCompat: true,
                relativeUrls: false,
              },
            },
          }
        },
        // You can add other presets/addons by using the string declaration
        '@storybook/preset-typescript',
        '@storybook/addon-actions',
      ]
    }
    

    Install

    npm i storybook-preset-less

    DownloadsWeekly Downloads

    7

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    4.62 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar