1.0.17 • Published 8 years ago

named-color-vars v1.0.17

Weekly downloads
10
License
MIT
Repository
github
Last release
8 years ago

Project Overview

2,065 named color variables (no duplicate names, no duplicate colors). Provided in JSON, SCSS and LESS formats. Color names courtesy of Resene Paints and the XKCD Color Survey (minus potentially-offensive color names & negative connotations). Additional color names include those supported by all major browsers in the CSS3 spec.

Installation Options

Install via package

$ npm install named-color-vars --save;

Or install via Yarn package

$ yarn add named-color-vars;

Or install via unpkg.com CDN

<script src="https://unpkg.com/named-color-vars@1.0.17" integrity="sha384-wu1yiJkXAQGYeWol5rKJ8e2BvqOCw0Cu6YHSUj3ZkusP1UEX0nUjnkorEFO0Dbuc" crossorigin="anonymous"></script>

Works in All Modern Browsers

If you need to support IE <= 11 (prior to Edge), older versions of Android, and much older versions of other browsers, you can insert this polyfill before all other script tags. The polyfill.io service fills ES6 features that a user's browser is lacking, based on both UA & feature detection.

<!-- Before ALL other script tags in your document. -->
<!-- Only needed if you want to support much older browsers. -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6&amp;flags=gated"></script>

Node.js Example

import {colors} from 'named-color-vars';
console.log(colors.springGreen); // #578363

Web Browser Example

<script src="https://unpkg.com/named-color-vars@1.0.17" integrity="sha384-wu1yiJkXAQGYeWol5rKJ8e2BvqOCw0Cu6YHSUj3ZkusP1UEX0nUjnkorEFO0Dbuc" crossorigin="anonymous"></script>

<script>
  var colors = namedColorVars.colors;
  console.log(colors.springGreen); // #578363
</script>

SCSS Example

You can download colors.scss here: https://unpkg.com/named-color-vars@1.0.17/src/colors.scss

@import 'colors.scss';

.my-style {
  color: $spring-green-color;
}

LESS Example

You can download colors.less here: https://unpkg.com/named-color-vars@1.0.17/src/colors.less

@import 'colors.less';

.my-style {
  color: @spring-green-color;
}

Commercial Use

This software is created, documented and maintained by Jason Caldwell (@jaswrks) and a small team of talented developers at ‹src.works/›. It's open source, but if you use it commercially, please pay what you can.

Development Channels

Always use the latest stable version in production. If you want upcoming changes ahead of time use the @dev or @rc tag, but please do so at your own risk. The @dev and @rc tags are potentially unstable at various times throughout a development cycle, and therefore should not be used in production.

NPM Consumption Examples

CDN Directory Indexes

CDN Script URLs

In production, use the latest stable version with an SRI integrity hash.

<script src="https://unpkg.com/named-color-vars@1.0.17" integrity="sha384-wu1yiJkXAQGYeWol5rKJ8e2BvqOCw0Cu6YHSUj3ZkusP1UEX0nUjnkorEFO0Dbuc" crossorigin="anonymous"></script>

Tip: Don't use an SRI hash with a tag like @dev, @rc, or @latest. Tags reference a version dynamically; e.g., the @latest tag will point to an updated copy once the next version is released. So a tagged release URL may render an SRI invalid. If you need the SRI, use a specific @x.x.x version in the URL instead of a tag.

MIT License

For full details see: LICENSE.txt

Changelog

For full details see: CHANGELOG.md

Semantic Versioning

New versions are released following semver.org guidelines.

Pull Requests Welcome

the master branch at GitHub and submit your changes for review.