css-color-types
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i css-color-types

Weekly Downloads

1

Version

0.3.0

License

ISC

Unpacked Size

3.98 kB

Total Files

3

Last publish

Collaborators

  • shawa.dev