Color

Color

yarn add @elodin/plugin-color

The color plugin converts all used colors into a consistent color format.

Usage

To use the plugin, simply add it to your Elodin configuration and you're ready to go.

elodin.config.js

import color from '@elodin/plugin-color'
module.exports = {
plugins: [color()],
}

Configuration

OptionTypeDefaultDescription
format
rgb
,
hsl
,
hex
,
keyword
rgb
The prefered output color format

Example

Let's say we want all colors to be written as

rgb
colors.

button.elo

(Input)

style Button {
backgroundColor: rgb(0 10 0)
borderTopColor: white
}

button.elo

(Output)

style Button {
backgroundColor: rgb(0 10 0)
borderTopColor: rgb(255 255 255)
}