Colors

Quickly pin down your brand's palette with some of the following techniques. Jack uses a number of generator functions behind the scenes to compile utility derivatives for a set of brand colors and colors that convey stateful meaning.

A carefully curated list of colors, grouped inside meaningful maps, leads to pre-generated components with your respective color themes intact. For a more ad-hoc approach, color variables can be pulled directly into components.

The examples below illustrate components which inherit brand or state color map set derivatives.


Add Brand Colors
Use the native map-merge functionality of Sass to add new colors to your brand array mapping.
// Testing out a new brand color
@import 'jack/settings/colors';
$colors_brand: map-merge($colors_brand, (experimental: #fa7162));

// Outputs
.btn--experimental { /* Salmon-flavored styles */ }
.alert--experimental { /* Salmon-flavored styles */ }
.divider--experimental { /* Salmon-flavored styles */ }
.card--experimental { /* Salmon-flavored styles */ }
.btn--experimental
.divider--experimental
.card--experimental
Lorem ipsum Elit laborum eu ullamco ex esse laboris sint aliquip eiusmod pariatur laborum Duis adipisicing eiusmod aute velit fugiat veniam in.

.well--experimental

Qui optio qui mollitia repellendus quaerat laudantium dolor. Et facere nulla magnam. Quos et dolorem dolorem recusandae.Look

  • .list__item--experimental
  • .list__item--experimental
  • .list__item--experimental

Remove Brand Colors
Use the native map-remove functionality of Sass to remove colors from your brand array mapping.
// Removing default "secondary" brand color
@import 'jack/settings/colors';
$colors_brand: map-remove($colors_brand, (secondary));

Add State Colors
Jack ships with 'success', 'warning', 'error', 'disabled', and 'info' states that reside in the $colors_states array map. This map is looped through by components like buttons, cards, and alerts. Use the native map-merge functionality of Sass to add colors from your brand array mapping. The underpinnings are identical to brand color extension, the key difference being semantics reserved for indicating component state.
// Add a 'welcome' state
@import 'jack/settings/colors';
$colors_brand: map-merge($colors_states, (welcome: #8bc34a));

// Outputs
.btn--welcome { background: #8bc34a; }
.alert--welcome { background: #8bc34a; }
.divider--welcome { background: #8bc34a; }
.card--welcome { background: #8bc34a; }
.btn--welcome
.divider--welcome
.card--welcome
Lorem ipsum Elit laborum eu ullamco ex esse laboris sint aliquip eiusmod pariatur laborum Duis adipisicing eiusmod aute velit fugiat veniam in.

.well-welcome!

Qui optio qui mollitia repellendus quaerat laudantium dolor. Et facere nulla magnam. Quos et dolorem dolorem recusandae.Look

  • .list__item--welcome-bar
  • .list__item--welcome-bar
  • .list__item--welcome-bar

Generate Classes
Auto-generate color shade derivative styling classes for any CSS property that accepts a color for the value, e.g. color, background, border-color, or fill You may also pass rgb/rgba/hsl properties as the base color.
// Generate shade derivative classes
@include generate-color-ticks('class', 'bg latte', #5258C7, 'background', 'lighten', 10%, 5);

// Outputs
.bg-latte-1 { background: #af9755; }
.bg-latte-2 { background: #bdaa74; }
.bg-latte-3 { background: #ccbd94; }
.bg-latte-4 { background: #dbd0b3; }
.bg-latte-5 { background: #eae3d2; }
.bg-latte-1
.bg-latte-2
.bg-latte-3
.bg-latte-4
.bg-latte-5

Generate Placeholders
Auto-emit color shade %placeholders for any CSS property that accepts a color for the value, e.g. color, background, border-color, or fill. You may also pass rgb/rgba/hsl properties as the base color.
// Generate shade derivatives placeholders
@include generate-color-ticks('placeholder', 'bg brand', #5258C7, 'background', 'darken', 10%, 5);

.section--angled:nth-of-type(1):after { @extend %bg_brand_3; }
.section--angled:nth-of-type(2):after { @extend %bg_brand_2; }
.section--angled:nth-of-type(3):after { @extend %bg_brand_4; }