Detalhes do pacote

postcss-color-rgb

dmarchena561.9kMIT2.0.0

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

postcss, css, postcss-plugin, color

readme (leia-me)

PostCSS Color Rgb Build Status Coverage Status

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

CSS Colors 4 syntax

rgb() = rgb( <percentage>{3} [ / <alpha-value> ]? ) |
        rgb( <number>{3} [ / <alpha-value> ]? )

<alpha-value> = <number> | <percentage>

CSS Colors 3 syntax (actual)

rgb() = rgb( <percentage>#{3}) |
        rgb( <integer>#{3})

rgba() = rgba( <percentage>#{3} , <alpha-value> ) |
         rgba( <integer>#{3} , <alpha-value> )

<alpha-value> = <number>

Example

.foo {
  /* Input example */
  color: rgb(250.5 255 255);
  background-image: linear-gradient(to bottom right, rgb(10% 11% 12% / 90%), rgb(23% 24% 25% / .5));
}
.foo {
  /* Output example */
  color: rgb(251, 255, 255);
  background-image: linear-gradient(to bottom right, rgba(10%, 11%, 12%, .9), rgba(23%, 24%, 25%, .5));
}

Usage

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

See PostCSS docs for examples for your environment.

changelog (log de mudanças)

1.1.4 - 2016-11-16

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

1.1.3 - 2016-11-16

  • Fix: Transform correctly when using spaces inside of parentheses
rgb( 100 102 103 / .3 );

1.1.2 - 2016-11-14

  • Fix: dist files

1.1.1 - 2016-11-13

  • Fix: coveralls badge

1.1.0 - 2016-11-11

  • Added: Now supports new comma-separated alternative syntax
.foo { 
  color: rgb(140 199 99.9);
  background-color: rgb(255 250 245.005 / 30%);
}

1.0.0 - 2016-11-10

✨ First release