0.3.0 • Published 1 year ago

css-color-types v0.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

css-color-types

Types for CSS named colors (aka keyword colors), webscraped from the W3C specification.

Installation

$ npm i --save-dev css-color-types

Usage

import type { CSSNamedColor } from "css-color-types"

const validColor: CSSNamedColor = "cornflowerblue" // no error.

const not_a_named_color: CSSNamedColor = "#FF0000" // Type '"#FF0000"' is not assignable to type '"black" | "silver" | "gray" | "white" | "maroon" | "red" | "purple" | "fuchsia" | "green" | "lime" | "olive" | "yellow" | "navy" | "blue" | "teal" | "aqua" | "aliceblue" | "antiquewhite" | ... 128 more ... | "yellowgreen"'.

const notAColor: CSSNamedColor = "Microsoft Bing" // Type '"Microsoft Bing"' is not assignable to type '"black" | "silver" etc.
0.3.0

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago