Skip to di men tin dɛn we de insay Skip to doks nevigishɔn
in English

Kɔlɔ dɛn

Konvey minin tru colorwit wan handful of kala yutiliti klas. Inklud sɔpɔt fɔ stayl link dɛn wit hova stet dɛn, bak.

Kɔlɔ dɛn

Kɔlɔ tɛks wit kɔlɔ yutiliti dɛn. If yu wan fɔ kala di link dɛn, yu kin yuz di .link-*ɛp klas dɛn we gɛt :hoverɛn :focusstet dɛn.

.tɛks-praymari

.tɛks-sɛkɔndari

.tɛks-sakses

.tɛks-denja

.tɛks-wɔnin

.tɛks-info

.tɛks-layt

.tɛks-dak

.tɛks-bɔdi

.tɛks-mut

.tɛks-wayt

.tɛks-blak-50

.tɛks-wayt-50

<p class="text-primary">.text-primary</p>
<p class="text-secondary">.text-secondary</p>
<p class="text-success">.text-success</p>
<p class="text-danger">.text-danger</p>
<p class="text-warning bg-dark">.text-warning</p>
<p class="text-info bg-dark">.text-info</p>
<p class="text-light bg-dark">.text-light</p>
<p class="text-dark">.text-dark</p>
<p class="text-body">.text-body</p>
<p class="text-muted">.text-muted</p>
<p class="text-white bg-dark">.text-white</p>
<p class="text-black-50">.text-black-50</p>
<p class="text-white-50 bg-dark">.text-white-50</p>
Fɔ gi minin to ɛtɛknɔlɔji dɛn we de ɛp

Yuz kala fɔ ad minin de jɔs gi wan vijual indikashɔn, we dɛn nɔ go gi to di wan dɛn we de yuz ɛtɛknɔlɔji dɛn we de ɛp – lɛk skrin rida dɛn. Mek shɔ se di infɔmeshɔn we dɛn sho wit di kɔlɔ de sho klia wan frɔm di tin we de insay insɛf (ɛgz. di tɛks we yu de si), ɔ dɛn put am insay ɔda we dɛn, lɛk ɔda tɛks we dɛn ayd wit di .visually-hiddenklas.

Spesifi k tin dɛn

Sɔntɛnde, dɛn nɔ kin ebul fɔ yuz kɔntɛkstual klas dɛn bikɔs ɔf di spɛsifisiti fɔ ɔda sɛlɛktɔ. Sɔntɛnde, wan naf wok-arawnd na fɔ rap yu ɛlimɛnt in kɔntinyu insay wan <div>ɔ mɔ sɛmantik ɛlimɛnt wit di klas we yu want.

Sass we bin de

Apat frɔm di Sass funkshɔnaliti dɛn we de dɔŋ ya, tink bɔt fɔ rid bɔt wi inklud CSS kɔstɔm prɔpati dɛn (aka CSS vɛriɔbul dɛn) fɔ kɔlɔ ɛn mɔ.

Di tin dɛn we kin chenj

Mɔs coloryutiliti dɛn de jenarayz bay wi tim kɔlɔ dɛn, we dɛn riasayn frɔm wi jenɛrik kɔlɔ palet vɛriɔbul dɛn.

$blue:    #0d6efd;
$indigo:  #6610f2;
$purple:  #6f42c1;
$pink:    #d63384;
$red:     #dc3545;
$orange:  #fd7e14;
$yellow:  #ffc107;
$green:   #198754;
$teal:    #20c997;
$cyan:    #0dcaf0;
$primary:       $blue;
$secondary:     $gray-600;
$success:       $green;
$info:          $cyan;
$warning:       $yellow;
$danger:        $red;
$light:         $gray-100;
$dark:          $gray-900;

Greyskɛl kɔlɔ dɛn de bak, bɔt na wan sɔbsɛt nɔmɔ dɛn de yuz fɔ mek ɛni yutiliti.

$white:    #fff;
$gray-100: #f8f9fa;
$gray-200: #e9ecef;
$gray-300: #dee2e6;
$gray-400: #ced4da;
$gray-500: #adb5bd;
$gray-600: #6c757d;
$gray-700: #495057;
$gray-800: #343a40;
$gray-900: #212529;
$black:    #000;

Map fɔ di map

Dɔn dɛn kin put tim kɔlɔ dɛn na wan Sass map so dat wi go ebul fɔ lɔp oba dɛn fɔ mek wi yutiliti dɛn, kɔmpɔnɛnt modifya dɛn, ɛn ɔda tin dɛn.

$theme-colors: (
  "primary":    $primary,
  "secondary":  $secondary,
  "success":    $success,
  "info":       $info,
  "warning":    $warning,
  "danger":     $danger,
  "light":      $light,
  "dark":       $dark
);

Greyscale kala dɛn de bak as Sass map. Dɛn nɔ de yuz dis map fɔ mek ɛni yutiliti.

$grays: (
  "100": $gray-100,
  "200": $gray-200,
  "300": $gray-300,
  "400": $gray-400,
  "500": $gray-500,
  "600": $gray-600,
  "700": $gray-700,
  "800": $gray-800,
  "900": $gray-900
);

Yutiliti dɛn API

Kɔlɔ yutiliti dɛn de diklar insay wi yutiliti dɛn API insay scss/_utilities.scss. Lan aw fɔ yuz di yutiliti dɛn API.

    "color": (
      property: color,
      class: text,
      values: map-merge(
        $theme-colors,
        (
          "white": $white,
          "body": $body-color,
          "muted": $text-muted,
          "black-50": rgba($black, .5),
          "white-50": rgba($white, .5),
          "reset": inherit,
        )
      )
    ),