A `babel-plugins-macros` macro for styled-components
⚠️ This repo is not active. If you want a macro for styled-components, use styled-components/macro
.
A babel-plugin-macros
macro for styled-components
.
import styled from 'styled-components.macro'
const Button = styled.button`
background: purple;
color: white;
`
// ...
Create-react-app is shipped already including babel-plugin-macros
, which makes it much easier to setup 🚀
styled-components
:yarn add styled-components
yarn add styled-components.macro --dev
styled-components
:yarn add styled-components
babel-plugin-macros
and add it to your babel config :// .babelrc
{
"plugins": ["macros"]
}
See babel-plugin-macros docs for more information about how to setup babel-plugin-macros
.
yarn add styled-components.macro --dev
This macro is using babel-plugin-styled-components
to transform your code. See babel-plugin-styled-components to see what transformations are applied.