emotion-to-vanilla-extract
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

emotion-to-vanilla-extract

Convert an Emotion CSSObject to a vanilla-extract ComplexStyleRule

Usage

import emotionToVanillaExtract from "emotion-to-vanilla-extract";

emotionToVanillaExtract({
  borderRight: "none",
  borderTop: "none",
  border: "1px solid red",
  borderLeft: "none",
  borderBottom: "none",
  "&:hover": {
    border: "2px solid red",
    "&:not(:active)": {
      border: "2px solid aquamarine",
      "[data-mode='dark'] &": {
        border: "2px solid white",
      },
    },
  },
})
// returns
{
  "borderRight": "none",
  "borderTop": "none",
  "border": "1px solid red",
  "borderLeft": "none",
  "borderBottom": "none",
  "selectors": {
    "&:hover": {
      "border": "2px solid red",
    },
    "&:not(:active):hover": {
      "border": "2px solid aquamarine",
    },
    "[data-mode='dark'] &:not(:active):hover": {
      "border": "2px solid white",
    },
  },
}

Package Sidebar

Install

npm i emotion-to-vanilla-extract

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

11.1 kB

Total Files

9

Last publish

Collaborators

  • penx