1.0.0 • Published 4 years ago

@superhuit/emotion-css-obj v1.0.0

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

@superhuit/emotion-css-obj

Drop-in replacement for Emotion's css() function, that returns an object instead of a generated class name.

Installation

npm install @superhuit/emotion-css-obj

or

yarn add @superhuit/emotion-css-obj

Description

The cssObj() function is a modified version of the Emotion's css() function:

  • Can still merge an array of objects
  • Offers the same developer experience that css() does
  • Returns, instead of a class name, an object with the merged styles.

It uses the CSSObject type from Emotion library, which enables the tools to have a good developer experience. It also uses a mergeDeep() function (adapted from here) to return a merged version of all the styles passed into it.

1.0.0

4 years ago