1.0.3 • Published 2 years ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-4

2 years ago

1.0.0-3

2 years ago

1.0.0-2

2 years ago

1.0.0-1

2 years ago

1.0.0-0

2 years ago