🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

react-cosmos-background-proxy

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cosmos-background-proxy

Easily apply a background for a fixture's playground and load global css

1.0.1
latest
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created

react-cosmos-background-proxy

Easily apply both global and fixture specific background settings for react-cosmos

Installation

npm install --save-dev react-cosmos-background-proxy

Usage

Basic

// cosmos.proxies.js
import createBackgroundProxy from 'react-cosmos-background-proxy';

export default [createBackgroundProxy()];
// __fixtures__/example.js
export default {
  component: MyComponent,
  // will apply this style to the <body> element of the fixture iFrame
  background: {
    backgroundColor: 'white'
  }
};

Global Styling

// cosmos.proxies.js
import createBackgroundProxy from 'react-cosmos-background-proxy';

export default [
  createBackgroundProxy(() => {
    // this will be invoked once when the playground is loaded
    require('node_modules/some-css-framework/dist/styles.css');
  })
];

Contributions are more than welcome! :beers:

FAQs

Package last updated on 17 Jul 2018

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