Git Product home page Git Product logo

sass-color-manager's Introduction

SCM: Sass Color Manager

A small Sass library for managing colors and their variations throughout a project

What SCM does

Everything SCM does is based on two maps: one for colors and one for variants. It provides a function to get any color in any pre-set variant:

.element {
  color: scm(red, dark);
}

How to add colors

To add a color, use the scm-add-color() mixin. It needs two arguments: a label for the color and its hex value:

@include scm-add-color(brand-blue, #205D84);

How to add variants

To add a variant, use the scm-add-variant() mixin. It takes three arguments: a label for the variant, the name of the Sass color function it uses, and the parameters for that function:

@include scm-add-variant(fade, rgba, .7);
@include scm-add-variant(dark, darken, 10%);
@include scm-add-variant(blueish, mix, (blue, 10%));

How to use the colors

In your Sass, use the function scm(color, variant) anywhere you can put a CSS color:

.test {
  color: scm(red, dark);
  border: 3px solid scm(orange, fade);
  
  &:hover {
    color: scm(red);
    border-color: scm(orange, light);
  }
}

sass-color-manager's People

Contributors

jdsteinbach avatar

Stargazers

Eric Rasch avatar Timothy Miller avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.