How to use @storybook/addon-cssresources - 1 common examples

To help you get started, we’ve selected a few @storybook/addon-cssresources examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikimedia / mediawiki-extensions-Popups / .storybook / config.js View on Github external
import { configure, addDecorator, addParameters } from '@storybook/html';
import { withCssResources } from '@storybook/addon-cssresources';
import jquery from 'jquery';
import mockMediaWiki from '../node_modules/@wikimedia/mw-node-qunit/src/mockMediaWiki.js';

global.mw = mockMediaWiki();
global.$ = jquery;

/**
 * Storybook global configuration
 */

addDecorator(
  withCssResources({
    cssresources: [{
    name: `x-ray`,
    code: `<style>
    body * {
	outline: 1px solid rgb(255, 0, 0);
	background-color: rgba(255, 0, 0, 0.07);}
    </style>`,
    picked: false,
  }],
})
);

// Option defaults:
addParameters( {
  options: {
    isFullScreen: false,

@storybook/addon-cssresources

A storybook addon to switch between css resources at runtime for your story

MIT
Latest version published 3 years ago

Package Health Score

75 / 100
Full package analysis

Popular @storybook/addon-cssresources functions