Socket
Socket
Sign inDemoInstall

css-color-keywords

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    css-color-keywords

A list of all CSS color keywords.


Version published
Weekly downloads
5.1M
decreased by-0.94%
Maintainers
1
Install size
7.34 kB
Created
Weekly downloads
 

Package description

What is css-color-keywords?

The css-color-keywords package provides a list of CSS color keywords as specified in CSS Color Module Level 4. It allows developers to access a comprehensive list of predefined color names that can be used in CSS files, making it easier to apply color styles without needing to remember specific color codes.

What are css-color-keywords's main functionalities?

Accessing CSS Color Keywords

This feature allows you to access the hexadecimal color code for CSS color keywords. The example demonstrates how to retrieve the color code for 'red'.

const colors = require('css-color-keywords');
console.log(colors.red); // Outputs the color code for 'red'

Iterating Over All Color Keywords

This feature enables iterating over all available CSS color keywords and their corresponding color codes. The code sample iterates through the color keywords and prints each color name along with its hexadecimal code.

const colors = require('css-color-keywords');
for (const color in colors) {
  console.log(`${color}: ${colors[color]}`);
}

Other packages similar to css-color-keywords

Readme

Source

css-color-keywords

A list of all CSS color keywords.

This list contains all CSS color keywords specified in:

  • CSS Level 1
  • CSS Level 2 (Revision 1)
  • CSS Color Module Level 3
  • CSS Color Module Level 4

See MDN for an overview of all colors.

Installation

$ npm install css-color-keywords --save

Usage

const cssColorKeywords = require('css-color-keywords')

cssColorKeywords.black // #000000
cssColorKeywords.orange // #ffa500

Returns an object where each key is a keyword (e.g. black) and the value is the keyword’s RGB hex value (e.g. #000000).

Even though CSS color keywords are case-insensitive, this list only contains lowercase keywords (and returns lowercase RGB hex values).

Changelog

This project follows Semantic Versioning 2.

This list aims to always include all CSS color keywords. If new keywords are specified, only the minor version will be bumped.

  • v1.0.0 (2017-01-20): Initial release

License

css-color-keywords is licensed under the ISC license. See LICENSE for the full license.

Keywords

FAQs

Last updated on 20 Jan 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc