Socket
Book a DemoInstallSign in
Socket

storybook-preset-less

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-preset-less

A preset for Storybook to add less support

latest
Source
npmnpm
Version
1.1.3
Version published
Weekly downloads
1.4K
-12.11%
Maintainers
1
Weekly downloads
 
Created
Source

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-less',
      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',
  ]
}

Keywords

storybook

FAQs

Package last updated on 25 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts