Source

Nānā nui

ʻO nā ʻāpana a me nā koho no ka waiho ʻana i kāu papahana Bootstrap, e komo pū ana i nā ipu wīwī, kahi ʻōnaehana māka ikaika, kahi mea media maʻalahi, a me nā papa hana pane.

Nā pahu pahu

ʻO nā pahu ka mea hoʻonohonoho maʻamau ma Bootstrap a koi ʻia i ka wā e hoʻohana ai i kā mākou ʻōnaehana grid default . E koho mai kahi pahu pane, paʻa-ākea (ʻo ia hoʻi kona max-widthhoʻololi ʻana i kēlā me kēia haʻihaʻi) a i ʻole ka laula-wai (ʻo ia hoʻi, he 100%ākea i nā manawa a pau).

ʻOiai hiki ke hoʻopaʻa ʻia nā ipu, ʻaʻole pono ka hapa nui o nā hoʻolālā i kahi ipu pūnana.

<div class="container">
  <!-- Content here -->
</div>

E hoʻohana .container-fluidno ka ipu laula piha, me ka laula holoʻokoʻa o ke awa ʻike.

<div class="container-fluid">
  ...
</div>

Nā wahi haʻi pane

No ka mea ua hoʻomohala ʻia ʻo Bootstrap e lilo i kelepona mua, hoʻohana mākou i kahi liʻiliʻi o nā nīnau media no ka hana ʻana i nā breakpoints noʻonoʻo no kā mākou papahana a me nā pilina. Hoʻokumu ʻia kēia mau wahi haʻihaʻi ma luna o nā ākea viewport liʻiliʻi a ʻae iā mākou e hoʻonui i nā mea e like me ka loli ʻana o ka viewport.

Hoʻohana mua ʻo Bootstrap i nā pae hulina media—a i ʻole nā ​​wahi haʻihaʻi—i loko o kā mākou kumu waihona Sass no kā mākou hoʻonohonoho, ʻōnaehana pūnaewele, a me nā ʻāpana.

// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }

No ko mākou kākau ʻana i kā mākou kumu CSS ma Sass, loaʻa kā mākou mau nīnau media āpau ma o Sass mixins:

// No media query necessary for xs breakpoint as it's effectively `@media (min-width: 0) { ... }`
@include media-breakpoint-up(sm) { ... }
@include media-breakpoint-up(md) { ... }
@include media-breakpoint-up(lg) { ... }
@include media-breakpoint-up(xl) { ... }

// Example: Hide starting at `min-width: 0`, and then show at the `sm` breakpoint
.custom-class {
  display: none;
}
@include media-breakpoint-up(sm) {
  .custom-class {
    display: block;
  }
}

Hoʻohana mākou i kekahi manawa i nā nīnau media e hele ana i kahi ʻaoʻao ʻē aʻe (ka nui o ka pale i hāʻawi ʻia a i ʻole ka liʻiliʻi ):

// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }

// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) { ... }

// Medium devices (tablets, less than 992px)
@media (max-width: 991.98px) { ... }

// Large devices (desktops, less than 1200px)
@media (max-width: 1199.98px) { ... }

// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width

No ka mea, ʻaʻole kākoʻo nā mākaʻikaʻi i kēia manawa i nā nīnau pōʻaiapili , hana mākou i nā palena a min-me max-nā prefix a me nā puka ʻike me nā laula haʻihaʻi (hiki ke hana ʻia ma lalo o kekahi mau kūlana ma nā hāmeʻa kiʻekiʻe-dpi, no ka laʻana) ma ka hoʻohana ʻana i nā waiwai me ka pololei o kēia mau hoʻohālikelike. .

Eia hou, loaʻa kēia mau nīnau media ma o Sass mixins:

@include media-breakpoint-down(xs) { ... }
@include media-breakpoint-down(sm) { ... }
@include media-breakpoint-down(md) { ... }
@include media-breakpoint-down(lg) { ... }
// No media query necessary for xl breakpoint as it has no upper bound on its width

// Example: Style from medium breakpoint and down
@include media-breakpoint-down(md) {
  .custom-class {
    display: block;
  }
}

Aia kekahi mau nīnau a me nā huila no ka huli ʻana i kahi ʻāpana o ka nui o ka pale e hoʻohana ana i ka laulā haʻahaʻa haʻahaʻa loa.

// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767.98px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991.98px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) and (max-width: 1199.98px) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }

Loaʻa kēia mau nīnau media ma o Sass mixins:

@include media-breakpoint-only(xs) { ... }
@include media-breakpoint-only(sm) { ... }
@include media-breakpoint-only(md) { ... }
@include media-breakpoint-only(lg) { ... }
@include media-breakpoint-only(xl) { ... }

Pēlā nō, hiki i nā nīnau media ke hoʻopaʻa i nā ākea breakpoint he nui:

// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199.98px) { ... }

ʻO ka Sass mixin no ka huli ʻana i ka nui o ka pale like:

@include media-breakpoint-between(md, xl) { ... }

Z-index

Hoʻohana kekahi mau ʻāpana Bootstrap z-index, ka waiwai CSS e kōkua i ka hoʻokele ʻana i ka hoʻolālā ma o ka hāʻawi ʻana i ke kolu ʻekolu e hoʻonohonoho i ka ʻike. Hoʻohana mākou i kahi pālākiō z-index paʻamau i Bootstrap i hoʻolālā ʻia e hoʻonohonoho pono i ka hoʻokele, nā mea hana a me nā popovers, modals, a me nā mea hou aku.

Hoʻomaka kēia mau waiwai kiʻekiʻe ma kahi helu kūʻokoʻa, kiʻekiʻe a kikoʻī e pale pono ai i nā paio. Pono mākou i kahi hoʻonohonoho maʻamau o kēia mau mea ma waena o kā mākou ʻāpana i hoʻopaʻa ʻia - nā mea hana, popovers, navbars, dropdowns, modals - no laila hiki iā mākou ke kūpaʻa kūpono i nā ʻano. ʻAʻohe kumu i hiki ʻole ai iā mākou ke hoʻohana 100+ a i ʻole 500+.

ʻAʻole mākou paipai i ka hoʻopilikino ʻana i kēia mau waiwai pākahi; inā ʻoe e hoʻololi i hoʻokahi, pono paha ʻoe e hoʻololi iā lākou a pau.

$zindex-dropdown:          1000 !default;
$zindex-sticky:            1020 !default;
$zindex-fixed:             1030 !default;
$zindex-modal-backdrop:    1040 !default;
$zindex-modal:             1050 !default;
$zindex-popover:           1060 !default;
$zindex-tooltip:           1070 !default;

No ka lawelawe ʻana i nā palena ʻāwili i loko o nā ʻāpana (e laʻa, nā pihi a me nā mea hoʻokomo i nā pūʻulu hoʻokomo), hoʻohana mākou i nā helu helu haʻahaʻa haʻahaʻa z-indexo 1, 2, a 3no ka paʻamau, hover, a me nā kūlana hana. Ma ka hover/focus/active, lawe mākou i kekahi mea i mua me ka z-indexwaiwai kiʻekiʻe e hōʻike i ko lākou palena ma luna o nā mea kaikaina.