Holo i ka ʻike nui Holo i ka hoʻokele docs
in English

Nā hoʻololi CSS

E hoʻohana i nā waiwai maʻamau o Bootstrap CSS no ka hoʻolālā a me ka hoʻomohala wikiwiki.

Loaʻa iā Bootstrap nā waiwai maʻamau CSS (nā mea hoʻololi) i kāna CSS i hōʻuluʻulu ʻia no ka hana maʻamau maoli me ka ʻole o ka pono e hoʻopili hou iā Sass. Hāʻawi kēia mau mea i ke ala maʻalahi i nā waiwai i hoʻohana mau ʻia e like me kā mākou mau kala kumuhana, nā wahi haʻihaʻi, a me nā pūʻulu kikokikona mua i ka wā e hana ai i ka mea nānā o kāu polokalamu kele pūnaewele, kahi pahu pahu code, a i ʻole ka prototyping maʻamau.

Hoʻopili mua ʻia kā mākou mau waiwai maʻamau mebs- ka pale ʻana i nā paio me ka CSS ʻaoʻao ʻekolu.

Nā hoʻololi kumu

Eia nā mea hoʻololi a mākou e hoʻokomo ai (e hoʻomaopopo :roothe koi ʻia) hiki ke kiʻi ʻia ma nā wahi āpau i hoʻouka ʻia ai ka CSS o Bootstrap. Aia lākou i loko o kā mākou _root.scssfaila a hoʻokomo ʻia i kā mākou faila dist i hui ʻia.

:root {
  --bs-blue: #0d6efd;
  --bs-indigo: #6610f2;
  --bs-purple: #6f42c1;
  --bs-pink: #d63384;
  --bs-red: #dc3545;
  --bs-orange: #fd7e14;
  --bs-yellow: #ffc107;
  --bs-green: #198754;
  --bs-teal: #20c997;
  --bs-cyan: #0dcaf0;
  --bs-white: #fff;
  --bs-gray: #6c757d;
  --bs-gray-dark: #343a40;
  --bs-gray-100: #f8f9fa;
  --bs-gray-200: #e9ecef;
  --bs-gray-300: #dee2e6;
  --bs-gray-400: #ced4da;
  --bs-gray-500: #adb5bd;
  --bs-gray-600: #6c757d;
  --bs-gray-700: #495057;
  --bs-gray-800: #343a40;
  --bs-gray-900: #212529;
  --bs-primary: #0d6efd;
  --bs-secondary: #6c757d;
  --bs-success: #198754;
  --bs-info: #0dcaf0;
  --bs-warning: #ffc107;
  --bs-danger: #dc3545;
  --bs-light: #f8f9fa;
  --bs-dark: #212529;
  --bs-primary-rgb: 13, 110, 253;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success-rgb: 25, 135, 84;
  --bs-info-rgb: 13, 202, 240;
  --bs-warning-rgb: 255, 193, 7;
  --bs-danger-rgb: 220, 53, 69;
  --bs-light-rgb: 248, 249, 250;
  --bs-dark-rgb: 33, 37, 41;
  --bs-white-rgb: 255, 255, 255;
  --bs-black-rgb: 0, 0, 0;
  --bs-body-color-rgb: 33, 37, 41;
  --bs-body-bg-rgb: 255, 255, 255;
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: 1rem;
  --bs-body-font-weight: 400;
  --bs-body-line-height: 1.5;
  --bs-body-color: #212529;
  --bs-body-bg: #fff;
}

Nā mea hoʻololi

Ke hoʻomaka nei nō hoʻi mākou e hoʻohana i nā waiwai maʻamau e like me nā ʻano hoʻololi kūloko no nā ʻāpana like ʻole. Ma kēia ala e hiki ai iā mākou ke hōʻemi i kā mākou CSS i hōʻuluʻulu ʻia, e hōʻoia i ka hoʻoili ʻole ʻia ʻana o nā kaila ma nā wahi e like me nā papa pūnana, a e ʻae i ka hoʻomaha ʻana a me ka hoʻonui ʻana i nā ʻāpana Bootstrap ma hope o ka hui ʻana o Sass.

E nānā i kā mākou palapala papaʻaina no ka ʻike i ke ʻano o kā mākou hoʻohana ʻana i nā ʻano CSS .

Ke hoʻohana nei mākou i nā mea hoʻololi CSS ma waena o kā mākou grids-ma mua no nā gutters-me ka hoʻohana ʻana i nā mea e hiki mai ana i ka wā e hiki mai ana.

Nā laʻana

Hāʻawi nā mea hoʻololi CSS i ka maʻalahi like me nā ʻano like ʻole o Sass, akā me ka ʻole o ka pono o ka hoʻohui ʻana ma mua o ka lawelawe ʻana i ka polokalamu kele pūnaewele. No ka laʻana, eia mākou e hoʻonohonoho hou ana i kā mākou ʻaoʻao font a me nā ʻano loulou me nā mea hoʻololi CSS.

body {
  font: 1rem/1.5 var(--bs-font-sans-serif);
}
a {
  color: var(--bs-blue);
}

Nā ʻāpana hoʻomaha

ʻOiai mākou e hoʻokomo i kā mākou mau wahi haʻihaʻi ma ke ʻano he mau hoʻololi CSS (koe wale nō xs), e makaʻala ʻaʻole hana nā mea hoʻololi CSS i nā nīnau media . ʻO kēia ma ka hoʻolālā ʻana i ka kikoʻī CSS no nā mea hoʻololi, akā hiki ke loli i nā makahiki e hiki mai ana me ke kākoʻo ʻana i env()nā loli. E nānā i kēia pane Stack Overflow no kekahi mau loulou kōkua. I kēia manawa, hiki iā ʻoe ke hoʻohana i kēia mau hoʻololi i nā kūlana CSS ʻē aʻe, a me kāu JavaScript.