1.0.3 • Published 3 years ago

babel-plugin-styled-components-css-variable v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

babel-plugin-styled-components-css-variable

Using css variable with style-components

Example:

Normal usage of css variable by styled-components:

const Title = styled.h1`
  --defaultColor: black;
  color: var(--defaultColor);
`;

<Title style={{ "--defaultColor": "orange" }} />;

But by this plugin we can pass value like this:

const Title = styled.h1`
  --defaultColor: black;
  color: var(--defaultColor);
`;

<Title $$defaultColor="orange" />;

Install

npm i babel-plugin-styled-components-css-variable
// or
yarn add babel-plugin-styled-components-css-variable

Configuration

// babel.config.json

{
  "plugins": ["babel-plugin-styled-components-css-variable"]
}
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-4

3 years ago

1.0.0-3

3 years ago

1.0.0-2

3 years ago

1.0.0-1

3 years ago

1.0.0-0

3 years ago