Skip to content

A SCSS Function which makes a color lighter or darker depending on the weight. E.g. color(primary, 700), color(text, 300), whereby the default weight is 500.

Notifications You must be signed in to change notification settings

JasonMHasperhoven/sass-scss-function-color-weight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

SCSS Color Function

Description

A SCSS Function which makes a color lighter or darker depending on the weight. E.g. color(primary, 700), color(text, 300) whereby the default weight is 500.

Function accepts 2 parameters color-name and weight.

Organize your colors across your application

Set your color in the $colors map.

Avoid variables like $color-primary-light, $color-primary-lighter and $color-primary-lightest.

Instead define primary in the map and use color-weights: color(primary, 400), color(primary, 300) and color(primary, 100).

Usage

Simply use the files in application/styles/color and replace the color variables with your own.

button {
  color: color(primary, 50);

  // this is the same as color(primary, 500)
  background: color(primary);
  border: 1px solid color(primary, 700);
}

About

A SCSS Function which makes a color lighter or darker depending on the weight. E.g. color(primary, 700), color(text, 300), whereby the default weight is 500.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages