postcss-gradientfixer

PostCSS plugin to rewrite code with existing vendor prefixes for CSS gradients code (especially -webkit-) and add equivalent un-prefixed CSS

Usage no npm install needed!

<script type="module">
  import postcssGradientfixer from 'https://cdn.skypack.dev/postcss-gradientfixer';
</script>

README

PostCSS gradientfixer Build Status

PostCSS plugin to rewrite code with existing vendor prefixes (especially -webkit-) on CSS gradients and add equivalent un-prefixed CSS.

For example, here's some CSS with vendor-specific prefix and a gradient syntax based on older versions of the CSS specifications:

.foo {
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ffffff), to(#f0efe7));
}

The unprefixer plugin will add the equivalent standard declarations (while leaving the old CSS for backwards compatibility with older WebKit-based browsers):

.foo {
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ffffff), to(#f0efe7));
  background: linear-gradient(to bottom, #ffffff 0%, #f0efe7 100%);
}

Usage

postcss([ require('postcss-gradientfixer') ])

See PostCSS docs for examples for your environment.