4.0.1 • Published 2 years ago

@pajn-linaria/babel-plugin-interop v4.0.1

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

@pajn-linaria/babel-plugin-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 @pajn-linaria/babel-plugin-interop

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

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