Skip to content

jlam55555/color-layer-generator

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 

Color Layer Generator

A Sass partial to generate background color "layers" as CSS classes

Span of 8-color basis


Simply add a CSS class to add a background-color. Not efficient (layering elements with JS is better for large sets of colors), but for small sets (colors < 7) this might come in handy!

Note that this is not really built for performance, but just to make layering background colors easily simply by adding CSS classes. This was inspired by this Stack Overflow question.

Usage:

@import 'path/to/_clg'
@include gen-layers($params)

Where @params is a list of the format:

$params: (
  '[class_name]': ([R], [G], [B], [A]),
  ...
)

See ./examples for a worked example.

About

A Sass partial to generate background color "layers" as CSS classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages