Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

postcss-color-hsl

dmarchena479.2kMIT2.0.0

PostCSS plugin to transform W3C CSS Color Module Level 4 hsl() new syntax to more compatible CSS (comma-separated hsl() or hsla())

postcss, css, postcss-plugin, color, hsl, hsla

readme

PostCSS Color Hsl Build Status Coverage Status

PostCSS plugin to transform W3C CSS Color Module Level 4 hsl() new syntax to more compatible CSS (comma-separated hsl() or hsla()).

CSS Colors 4 syntax

hsl() = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? )
<hue> = <number> | <angle>
<alpha-value> = <number> | <percentage>

CSS Colors 3 syntax (actual)

hsl()  = hsl( <hue>, <percentage>, <percentage> )
hsla() = hsla( <hue>, <percentage>, <percentage>, <alpha-value> )
<hue> = <number>
<alpha-value> = <number>

Example

.foo {
  /* Input example */
  color: hsl(0 100% 50%);
  border-color: hsl(200grad 100% 50% / 20%);
}
.foo {
  /* Output example */
  color: hsl(0, 100%, 50%);
  border-color: hsla(180, 100%, 50%, .2);
}

Usage

postcss([ require('postcss-color-hsl') ])

See PostCSS docs for examples for your environment.

changelog

1.0.5 - 2016-11-16

  • Fix: Move postcss-value-parser from devDependencies to dependencies

1.0.4 - 2016-11-16

  • Fix: Transform correctly when using spaces inside of parentheses
( 120deg 100% 75% / 100% );

1.0.3 - 2016-11-14

  • Fix hue angle-to-number conversion

1.0.2 - 2016-11-14

  • Fix dist files

1.0.1 - 2016-11-13

  • Remove console.dir()

1.0.0 - 2016-11-13

✨ First release