Hla mus rau cov ntsiab lus tseem ceeb Hla mus rau docs navigation

Qhia lub ntsiab lus los ntawm colorkev txhais tes ntawm cov chav kawm siv xim xim. suav nrog kev txhawb nqa rau kev sib txuas styling nrog hover xeev, ib yam nkaus.

Xim

Colorize cov ntawv nrog cov khoom siv xim. Yog tias koj xav ua kom muaj xim sib txuas, koj tuaj yeem siv cov .link-*chav kawm pab uas muaj :hoverthiab :focushais.

.text-primary

.text-secondary

.text-ua tiav

.text-kev phom sij

.text-warning

.text-info

.text-light

.text-dub

.text-lub cev

.text-muted

.text-dawb

.text-dub-50

.text-dawb-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>
Qhia lub ntsiab lus rau kev pab technologies

Siv cov xim los ntxiv cov ntsiab lus tsuas yog muab qhov pom kev pom, uas yuav tsis raug xa mus rau cov neeg siv cov thev naus laus zis pab - xws li cov ntawv nyeem. Xyuas kom meej tias cov ntaub ntawv qhia los ntawm cov xim yog pom tseeb los ntawm cov ntsiab lus nws tus kheej (xws li cov ntawv pom), lossis suav nrog lwm txoj kev, xws li cov ntawv ntxiv zais nrog cov .visually-hiddenchav kawm.

Qhov tshwj xeeb

Qee zaum cov chav kawm hauv cov ntsiab lus tsis tuaj yeem siv vim qhov tshwj xeeb ntawm lwm tus neeg xaiv. Qee zaum, kev ua haujlwm txaus yog los qhwv koj lub ntsiab lus hauv ib <div>lossis ntau lub ntsiab lus nrog cov chav kawm xav tau.

Sass

Ntxiv rau cov haujlwm Sass hauv qab no, xav txog kev nyeem txog peb cov khoom siv CSS suav nrog (aka CSS variables) rau xim thiab ntau dua.

Hloov pauv

Cov colorkhoom siv feem ntau yog tsim los ntawm peb cov ntsiab lus xim, muab rov qab los ntawm peb cov xim palette sib txawv.

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

Greyscale xim kuj muaj, tab sis tsuas yog ib lub subset yog siv los tsim cov khoom siv.

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

Daim ntawv qhia

Cov ntsiab lus xim raug muab tso rau hauv Sass daim ntawv qhia yog li peb tuaj yeem hla lawv los tsim peb cov khoom siv hluav taws xob, cov khoom hloov kho, thiab lwm yam.

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

Greyscale xim kuj muaj raws li daim ntawv qhia Sass. Daim ntawv qhia no tsis yog siv los tsim cov khoom siv hluav taws xob.

$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

Cov khoom siv xim xim tau tshaj tawm hauv peb cov khoom siv API hauv scss/_utilities.scss. Kawm paub siv cov khoom siv hluav taws xob API li cas.

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