1.0.10 • Published 4 years ago

minify-css.macro v1.0.10

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

A babel plugin for removing the whitespace from a CSS-generating tagged template literal while preserving function/variable instances.

Prerequisites

Using this plugin requires that you are also using babel-plugin-macros (included in create-react-app by default)

Usage

// [Input]
import css from 'minify-css.macro'

const getStyle = (theme) => css`
  text-align: center;
  font: ${theme.font.primary};
`

// [Output]

const getStyle = (theme) => 'text-align:center;font:' + theme.font.primary + ';'

LICENSE

MIT