npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sass-material-colors

v0.0.5

Published

Google's Material Design colors for Sass/Scss

Readme

Sass Material Colors Gem Version

An easy way to use Google's Material Design color palette on your Sass project.

Installation

Sass Material Colors can be included as a Ruby Gem, a Bower component, or a Node Packaged Module (npm).

Ruby Gem

Add this line to your application's Gemfile:

$ gem 'sass-material-colors'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sass-material-colors

Bower Component

Install sass-material-colors as a development dependency:

$ bower install --save-dev sass-material-colors

Node Packaged Module (npm)

Install sass-material-colors as a development dependency:

$ npm install --save-dev sass-material-colors

Usage

Import the colors map + function to your project:

// Sass
@import 'sass-material-colors'

If you're using Bower or npm, you may need to use the relative path to the main file, e.g.:

// Sass

// Bower
@import 'bower_components/sass-material-colors/sass/sass-material-colors'

// npm
@import 'node_modules/sass-material-colors/sass/sass-material-colors'

By importing this file, a $material-colors Sass map will be added to your Sass project, with all the colors from Google's palette, as well as a material-color function, making it easy for you to reference any color in the spec from your stylesheets.

Optionally, you can import a list of placeholder selectors and/or classes.

The material-color Function

The material-color function allows you to easily reference any color in the _sass-material-colors-map.scss file in your styles:

// Sass
.my-cool-element
  color: material-color('cyan', '400')
  background: material-color('blue-grey', '600')

The material-color function takes 2 parameters:

$color-name String (quoted), Required

Lower-case, dasherized color name from Google's palette (e.g. 'pink', 'amber', 'blue-grey', 'deep-orange', etc.)

$color-variant String (quoted), Optional [Default value: 500]

Lower-case color variant number/code from Google's palette (e.g. '300', '200', 'a100', 'a400', etc.)

It's important for these parameters to be quoted strings, in order to maintain compatibility with Libsass.

Predefined Sass Placeholder Selectors

You can include a list of extendable Sass placeholder selectors in your project by importing the sass-material-colors-placeholders file into your Sass/Scss:

// Sass
@import 'sass-material-colors-placeholders'

This will add a %color-... and %bg-color-... placeholder selector for each color name and variant found in Google's palette to your project, which you can then extend in your stylesheets like so:

// Sass
.my-cool-element
  @extend %color-cyan-400
  @extend %bg-color-blue-grey-600

Predefined Classes

You can include a list of predefined classes in your project by importing the sass-material-colors-classes file into your Sass/Scss:

// Sass
@import 'sass-material-colors-classes'

This will add a .color-... and .bg-color-... class for each color name and variant found in Google's palette to your stylesheets, which you can then use directly in your markup like so:

<!-- HTML -->
<div class='my-cool-element color-cyan-400 bg-color-blue-grey-600'></div>

TO-DO

  • [x] ~~Make it bower friendly~~
  • [x] ~~Make it npm friendly~~
  • [ ] Create ember-cli addon
  • [ ] Pre-compile -placeholders and -classes files
  • [ ] Separate color (text) and background classes
  • [ ] Add tests
  • [ ] Add changelog

Contributing

See CONTRIBUTING.

License

See LICENSE.

Special Thanks

To nilskaspersson/Google-Material-UI-Color-Palette for the inspiration on using a Sass map for the colors, and a map function to retrieve them.

To twbs/bootstrap-sass as a reference for this gem.

And to Google for their Material Design spec.