Main content ah kal rawh Docs navigation ah kal rawh
in English

A rawng hrang hrang

colorColor utility class tlemte hmangin awmzia sawifiah rawh . Hover states nena styling links support a awm bawk.

A rawng hrang hrang

Text chu color utilities hmangin colorize rawh. Links colorize duh chuan .link-*helper classes which have :hoverleh :focusstates te hi i hmang thei ang.

.text-a hmasa ber a ni

.text-secondary tih a ni

.text-hlawhtlinna

.text-hlauhawm tak a ni

.text-vaukhânna

.text-info a ni

.text-eng a ni

.text-thim a ni

.text-taksa a ni

.text-muted a ni

.text-a var a ni

.text-black-50 tih a ni

.text-white-50 tih a ni

<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>
Assistive technology-te hnena awmzia thlentu

awmzia belhchhah nan color hman hian hmuh theiha hriattirna chauh a pe a, chu chu assistive technology hmangtute hnenah a thlen dawn lo – screen reader ang chi te. Color hmanga tarlan information chu a thupui a\ang ngeia lang (entir nan, hmuh theih thuziak), a nih loh leh kawng dang hmanga telh a nih theih nan enfiah rawh, chu chu .visually-hiddenclass nena thup belh thuziak ang chi a ni.

A bik takin

A châng chuan selector dang specificity vangin contextual class hi hman theih a ni lo. A then phei chuan workaround tling tak chu i element content chu <div>class duh ang nen semantic element pakhat emaw a aia tam emaw-a wrap hi a ni.

Sass a ni

A hnuaia Sass functionality bakah hian kan included CSS custom properties (aka CSS variables) te chu color leh thil dang tam tak tan chhiar tum ang che.

Variables te pawh a awm

Utility tam zawk colorhi kan theme colors atanga siam a ni a, kan generic color palette variable atanga reassign a ni.

$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;

Grayscale color pawh a awm a, mahse subset chauh hmangin utility eng pawh siam a ni.

$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 a ni

Chumi hnuah chuan theme color te chu Sass map ah dah a ni a, chutiang chuan kan utilities, component modifier leh thil dang tam tak siam turin kan loop thei a ni.

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

Sass map angin grayscale color pawh a awm bawk. He map hi utility engmah siam nan hman a ni lo.

$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
);

Utilities API hmanga thil tih a ni

Color utilities hi kan utilities API ah hian scss/_utilities.scss. Utilities API hman dan zir rawh.

    "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,
        )
      )
    ),