Nā kala
Hāʻawi i ka manaʻo ma o color
ka lima o nā papa hana kala. Hoʻokomo pū ʻia ke kākoʻo no ke kālai ʻana i nā loulou me nā mokuʻāina hover.
Nā kala
E kala i ka kikokikona me nā pono kala. Inā makemake ʻoe e kala i nā loulou, hiki iā ʻoe ke hoʻohana i .link-*
nā papa kōkua i loaʻa :hover
a me :focus
nā mokuʻāina.
.text-primary
.text-secondary
.text-success
.text-pilikia
.palapala kikokikona
.text-info
.kukui-kukui
.text-pouli
.kino kikokikona
.mehameha kikokikona
.text-keʻokeʻo
.text-black-50
.text-white-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>
Ka lawe ʻana i ka manaʻo i nā ʻenehana kōkua
ʻO ka hoʻohana ʻana i ke kala e hoʻohui i ka manaʻo e hāʻawi wale i kahi hōʻailona ʻike, ʻaʻole e hāʻawi ʻia i nā mea hoʻohana i nā ʻenehana kōkua - e like me nā mea heluhelu pale. E hōʻoia i ka ʻike i hōʻike ʻia e ka waihoʻoluʻu i ʻike ʻia mai ka maʻiʻo ponoʻī (e laʻa i ke kikokikona ʻike ʻia), a i ʻole e hoʻokomo ʻia ma o nā ala ʻē aʻe, e like me nā kikokikona hou i hūnā ʻia me ka .visually-hidden
papa.
kikoo
I kekahi manawa ʻaʻole hiki ke hoʻohana ʻia nā papa contextual ma muli o ke ʻano kikoʻī o kahi mea koho ʻē aʻe. I kekahi mau hihia, ʻo kahi hoʻoponopono kūpono ʻo ia ke kāwili ʻana i ka ʻike o kāu mea i loko o kahi <div>
mea semantic a ʻoi aku paha me ka papa i makemake ʻia.
Sass
Ma waho aʻe o kēia mau hana Sass, e noʻonoʻo e heluhelu e pili ana i kā mākou mau waiwai maʻamau CSS i hoʻokomo ʻia (aka CSS variables) no nā kala a me nā mea hou aku.
Nā mea hoʻololi
Hoʻokumu ʻia ka hapa nui o color
nā pono e kā mākou mau kala kumuhana, i hoʻihoʻi ʻia mai kā mākou mau ʻano palette kala maʻamau.
$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;
Loaʻa nā kala kalahina, akā hoʻohana ʻia kahi ʻāpana no ka hana ʻana i nā pono hana.
$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;
Palapala ʻāina
Hoʻokomo ʻia nā waihoʻoluʻu kumuhana i loko o kahi palapala ʻāina Sass i hiki iā mākou ke hoʻopaʻa i luna o lākou e hana i kā mākou mau pono, nā mea hoʻololi ʻāpana, a me nā mea hou aku.
$theme-colors: (
"primary": $primary,
"secondary": $secondary,
"success": $success,
"info": $info,
"warning": $warning,
"danger": $danger,
"light": $light,
"dark": $dark
);
Loaʻa nā kala kalahina ma ke ʻano he palapala ʻāina Sass. ʻAʻole hoʻohana ʻia kēia palapala ʻāina no ka hana ʻana i nā pono hana.
$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
);
API no nā pono hana
Hōʻike ʻia nā pono kala i kā mākou API ponoʻī ma scss/_utilities.scss
. E aʻo pehea e hoʻohana ai i nā pono 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,
)
)
),