Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

accoutrement-color

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accoutrement-color

Sass color-palette management and utilities.

  • 2.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
244
increased by29.1%
Maintainers
2
Weekly downloads
 
Created
Source

Accoutrement-Color

Sass color-palette management by OddBird

  • Organize all your colors into a single map, or set of maps
  • Document color relationships directly in the code
  • Automate WCAG-appropriate contrast checking
  • Generate color-palette documentation with Herman

OddBird's Accoutrement toolkits are designed around the idea that code should be meaningful to both humans and machines – opening the door for automation, while improving or maintaining readability. These tools integrate with Herman, our automated living pattern-library generator built on SassDoc.

Other Accoutrement include…

  • Init provides lightweight browser-normalization.
  • Scale helps manage scale patterns like font-sizes, margins, and gutters.
  • Type provides webfont management tools, and other typography helpers.
  • Layout provides layout utilities such as box-sizing, intrinsic ratios, z-index management, named media-queries, and a clearfix.

Quick Start: Colors

Install the package with npm or yarn:

npm install accoutrement-color
yarn add accoutrement-color

Import the library:

@import '<path-to>/accoutrement-color/sass/color';

Establish your color palette:

$colors: (
  // set explicit colors
  'brand-pink': hsl(330, 85%, 62%),
  'brand-light': #ddf,
  'brand-dark': #224,

  // reference existing colors
  'background': 'brand-light',
  'border': 'brand-dark',

  // make adjustments as needed, using color functions
  'link': 'brand-pink' ('shade': 25%, 'desaturate': 15%),
);

Access your colors from anywhere:

.example {
  border-color: color('border');
}

You can also define your colors in smaller maps, and then add them to the global $colors variable using the merge-color() function, or add-colors() mixin.

$brand: (
  'brand-pink': hsl(330, 85%, 62%),
  'brand-light': #ddf,
  'brand-dark': #224,
);

$patterns: (
  'background': 'brand-light',
  'border': 'brand-dark',
  'link': 'brand-pink' ('shade': 25%),
);

// merge everything into the main $colors map…
@include add-colors($brand, $patterns);

We'll also help you calculate WCAG-appropriate color contrasts:

a:hover {
  // set a background, and get well-contrasted text
  @include contrasted('link');

  // or return a contrasting color for use anywhere…
  border-color: contrast('background');
}

Keywords

FAQs

Package last updated on 04 Apr 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc