postcss-colorstring

PostCSS plugin to turn any string into a valid color

Usage no npm install needed!

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

README

PostCSS colorstring Build Status

PostCSS plugin to turn any string into a valid color.

based on
http://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color
http://scrappy-do.blogspot.be/2004/08/little-rant-about-microsoft-internet.html

Installation

$ npm install postcss-color-hcl

Usage

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

Using this input.css:

.foo {
  color-ie:  Supercalifragilisticexpialidocious;
}

you will get:

.foo {
  color: #0c000c;
}

See PostCSS docs for examples for your environment.