Source

Kpɔɖeŋunyagbɔgblɔ

Kpeɖeŋutɔ kple tiatia siwo nàwɔ atsɔ aɖo wò Bootstrap dɔa ɖe ɖoɖo nu, siwo dometɔ aɖewoe nye nugoewo babla, grid ɖoɖo sesẽ aɖe, nyadzɔdzɔgblɔmɔ̃ ƒe nu si te ŋu trɔna bɔbɔe, kple dɔwɔnu ƒe klass siwo ɖoa nya ŋu.

Nugoewo me

Nugoewo nye ɖoɖowɔɖi ƒe akpa vevitɔ kekeake le Bootstrap me eye wohiã ne wole míaƒe grid ɖoɖo si woɖo ɖi la zãm . Tia nugoe si wɔa dɔ, si ƒe kekeme le ɖoɖo nu (si fia be eƒe max-widthtɔtrɔwo le gbagbãƒe ɖesiaɖe) alo tsi ƒe kekeme (si fia be 100%ekeke ɣesiaɣi).

Togbɔ be woateŋu atsɔ nugoewo aɖo atɔ me hã la, ɖoɖo akpa gãtɔ mehiã be woatsɔ nugoe aɖo atɔ me o.

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

Zãe .container-fluidna nugoe si ƒe kekeme bliboa, si keke ɖe enu le nukpɔƒea ƒe kekeme bliboa me.

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

Gbeɖeka siwo ɖoa nya ŋu

Esi wònye be wowɔ Bootstrap be wòanye asitelefon gbã ta la, míezãa nyadzɔdzɔgblɔmɔnuwo ƒe nyabiase ʋɛ aɖewo tsɔ wɔa vovototo siwo me susu le na míaƒe ɖoɖowo kple ŋgɔdonyawo. Wotu gbagbãƒe siawo ƒe akpa gãtɔ ɖe nukpɔkpɔ ƒe kekeme suetɔ kekeake dzi eye woɖea mɔ na mí be míadzi nuawo ɖe edzi ne nukpɔkpɔa le tɔtrɔm.

Bootstrap koŋ zãa media biabia ƒe didime siwo gbɔna—alo breakpoints—le míaƒe dzɔtsoƒe Sass faɛlwo me na míaƒe ɖoɖo, grid ɖoɖo, kple akpawo.

// 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) { ... }

Esi míeŋlɔa míaƒe dzɔtsoƒe CSS ɖe Sass me ta la, míaƒe nyadzɔdzɔgblɔmɔnuwo katã li to Sass mixins dzi:

// 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;
  }
}

Míezãa nyadzɔdzɔgblɔmɔnuwo ƒe nyabiase siwo yia mɔ bubu dzi ɣeaɖewoɣi (screen ƒe lolome si wona alo esi le sue wu ):

// 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

De dzesii be esi wònye be browsers doa alɔ range context queries fifia o ta la , míewɔa dɔ tso seɖoƒewo min-kple max-prefixes kple viewports kple fractional widths (si ate ŋu adzɔ le nɔnɔme aɖewo me le high-dpi devices dzi, le kpɔɖeŋu me) to asixɔxɔ siwo le pɛpɛpɛ wu zazã me na tsɔtsɔ sɔ kple wo nɔewo siawo .

Le afisia hã la, nyadzɔdzɔgblɔmɔnuwo ƒe nyabiase siawo hã li to Sass mixins dzi:

@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;
  }
}

Media biabia kple mixins hã li hena taɖodzinu ɖoɖo ɖe screen ƒe lolome ƒe akpa ɖeka ŋu to breakpoint ƒe kekeme suetɔ kple gãtɔ zazã me.

// 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) { ... }

Media biabia siawo hã li to Sass mixins dzi:

@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) { ... }

Nenema ke nyadzɔdzɔgblɔmɔnuwo ƒe nyabiasewo ateŋu akeke ta ɖe breakpoint ƒe kekeme geɖe ŋu:

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

Sass mixin si woatsɔ aɖo taɖodzinu na screen ƒe lolome ƒe didime ɖeka ma ke anye:

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

Z-nufiamefianu

Bootstrap ƒe akpa geɖewo zãa z-index, CSS ƒe nɔnɔme si kpena ɖe ɖoɖowɔɖi dzi kpɔkpɔ ŋu to axis etɔ̃lia nana be wòaɖo nyatakakawo ɖe ɖoɖo nu me. Míezãa z-index dzidzenu si woɖo ɖi le Bootstrap me si wowɔ be wòatsɔ aɖo mɔfiamewo, dɔwɔnuwo kple popovers, modals, kple bubuwo la nyuie.

Asixɔxɔ siawo siwo kɔ wu la dzea egɔme tso xexlẽme si woɖo ɖi dzi, si kɔkɔ eye wòle tẽ ale gbegbe be le mɔ nyuitɔ nu la, woaƒo asa na masɔmasɔwo. Míehiã esiawo ƒe ɖoɖo si sɔ le míaƒe akpa siwo le ƒuƒoƒo me—dɔwɔnu ƒe aɖaŋuɖoɖowo, popovers, navbars, dropdowns, modals—ale be míate ŋu awɔ ɖeka le nuwɔnaawo me le mɔ si sɔ nu. Susu aɖeke meli si tae míate ŋu azã 100+ alo 500+ hafi o.

Míedea dzi ƒo be woatrɔ asi le dzidzenu ɖekaɖeka siawo ŋu o; ne ètrɔ ɖeka la, anɔ eme be ahiã be nàtrɔ wo katã.

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

Be míakpɔ liƒo siwo ƒo xlã wo nɔewo le akpawo me gbɔ (le kpɔɖeŋu me, abɔtawo kple nyawo tsɔtsɔ de eme le nyawo tsɔtsɔ de eme ƒe ƒuƒoƒowo me), míezãa xexlẽdzesi ɖeka ƒe z-indexasixɔxɔ siwo le bɔbɔe siwo nye 1, 2, kple 3na nɔnɔme siwo woɖo ɖi, hover, kple nɔnɔme siwo le dɔ wɔm. Le hover/focus/active dzi la, míetsɔa nu tɔxɛ aɖe vaa ŋgɔgbe kple z-indexasixɔxɔ si kɔkɔ wu be míaɖe woƒe liƒo afia ɖe nɔviawo ƒe akpaawo dzi.