react-cosmos-styled-components-proxy

A proxy for react-cosmos to load styled-components themes.

Usage no npm install needed!

<script type="module">
  import reactCosmosStyledComponentsProxy from 'https://cdn.skypack.dev/react-cosmos-styled-components-proxy';
</script>

README

react-cosmos-styled-components-proxy

A simple proxy for react-cosmos to load styled-components themes.

It's basically wrapping your components with a ThemeProvider.

Forked from react-cosmos-glamorous-proxy

Getting started

Be sure to have all needed peer dependencies installed.

Import styled-components-proxy and create a new proxy instance with your theme:

// src/cosmos.proxies.js
import createStyledComponentsProxy from "react-cosmos-styled-components-proxy";
import theme from "theme/myTheme";

const styledComponentsProxy = createStyledComponentsProxy({
  theme
});

export default  = [styledComponentsProxy];