New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

postcss-randomcolor

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-randomcolor

PostCSS plugin supports function to use random colors

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

PostCSS Randomcolor Build Status

PostCSS plugin supports function to use random colors.

:root{
    --red: randomColor(random, red);
}
.foo {
  border-color: randomColor;
  background: randomColor(light);
  color: randomColor(dark, blue);
}
:root{
    --red: #d65755;
}
.foo {
  border-color: #5dd8b9;
  background: #d5c9ff;
  color: #090070;
}

Options of randomColor function

luminosity

Luminosity of the color
Type: string -> random, bright, light, dark
Default: random

.foo {
    color: randomColor(bright);
}

hue

Hue of the color
Type: string -> random, red, orange, yellow, green, blue, purple, pink, monochrome
Default: random

.foo {
    color: randomColor(random, orange);
}

## Usage

```js
postcss([ require('postcss-randomcolor')(options) ])

See PostCSS docs for examples for your environment.

Plugin options

options.functionName

Name of the function that insert random color
Type: string
Default: randomColor

postcss([ require('postcss-randomcolor')({functionName: 'random-color'}) ])
.foo {
    color: random-color;
}

options.format

Format of the color
Type: string -> hex, hsl, rgb
Default: hex

Keywords

postcss

FAQs

Package last updated on 29 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts