1.2.0 • Published 5 years ago

babel-plugin-linaria-interop v1.2.0

Weekly downloads
22
License
MIT
Repository
github
Last release
5 years ago

babel-plugin-linaria-interop

This plugin allows to interpolate Linaria components inside styled-components and Emotion:

import styled from 'styled-components';
import { Title } from './Title.styled'; // Linaria component

const Article = () => { /* … */ };

export default styled(Article)`
  & > ${Title} {
    color: green;
  }
`;

Quick start

Install the plugin first:

npm install --save-dev babel-plugin-linaria-interop

Then add linaria-interop to your babel configuration before styled-components:

{
  "plugins": [
    ["linaria-interop", { "library": "styled-components" }],
    "styled-components"
  ]
}