noaignite / create-ignite-app

Boilerplate for React with Next.js and MUI
17 stars 2 forks source link

Feature/emotion-component-reference #54

Closed AhmedAbdulrahman closed 2 years ago

AhmedAbdulrahman commented 2 years ago

Overview

This PR enables emotion components to be targeted like regular CSS selectors using @emotion/babel-plugin. Working for MUI v5 client-side & server-side application


const Parent = styled.div`
  background: 'white'
`

const Button = styled.button`
  color: green;

 [`${Parent} &`] : {
  color: 'red'
 }
`