0.0.3 • Published 7 years ago

glamor-color-function v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

glamor-color-function

A port of postcss-color-function for glamor, using css-color-function.

Transform glamor declarations with color():

css({
  border: "1px solid pink",
  color: "color(blue blackness(+10%))",
  ":hover": { backgroundColor: "red" }
})

into

.css-1bl95om,[data-css-1bl95om]{
  border: 1px solid pink;
  color: rgb(0, 0, 230);
}
.css-1bl95om:hover,[data-css-1bl95om]:hover{
  background-color: red;
}

ECMAScript

You will need polyfills for the following features (which are provided for you if you are using babel's runtime).

  • Object.entries
  • "".startsWith()

A non-compiled version can be required at index.es.js and is specified as jsnext:main. This version includes the following language features in addition:

  • Destructuring
  • Object literal shorthand