Kwimukira kuri v5
Kurikirana kandi usubiremo impinduka kuri dosiye ya Bootstrap yinkomoko, inyandiko, nibigize kugirango bigufashe kwimuka uva kuri v4 ujya kuri v5.
v5.2.0
Igishushanyo mbonera
Bootstrap v5.2.0 igaragaramo igishushanyo mbonera cyibishushanyo mbonera cyibikoresho byinshi hamwe numutungo hirya no hino mumushinga, cyane cyane binyuze mumico inonosoye border-radius
kuri buto no kugenzura imiterere . Inyandiko zacu nazo zavuguruwe hamwe nurupapuro rushya, imiterere ya docs yoroshye itagisenyuka ibice byuruhande, hamwe nuburorero bukomeye bwibishushanyo bya Bootstrap .
Impinduka nyinshi za CSS
Twahinduye ibice byose kugirango dukoreshe impinduka za CSS. Mugihe Sass ikomeje gushimangira ibintu byose, buri kintu cyaravuguruwe kugirango gishyiremo CSS ihindagurika kumyanya shingiro yibice (urugero, .btn
), itanga igihe nyacyo cyo kwihindura Bootstrap. Mubisohoka nyuma, tuzakomeza kwagura imikoreshereze yimikorere ya CSS muburyo bwacu, imiterere, abafasha, hamwe nibikorwa byingirakamaro. Soma byinshi kubyerekeye CSS ihinduka muri buri kintu kurupapuro rwihariye.
Imikoreshereze yacu ya CSS izaba ituzuye kugeza Bootstrap 6. Mugihe twifuza kubishyira mubikorwa byuzuye, bafite ibyago byo guteza impinduka. Kurugero, gushiraho $alert-border-width: var(--bs-border-width)
inkomoko yacu code isenya Sass muri code yawe niba wakoraga $alert-border-width * 2
kubwimpamvu.
Nkibyo, aho bishoboka hose, tuzakomeza gusunika kuri CSS nyinshi zihinduka, ariko nyamuneka umenye ko ishyirwa mubikorwa ryacu rishobora kuba rito muri v5.
Gishya_maps.scss
Bootstrap v5.2.0 yazanye dosiye nshya ya Sass hamwe _maps.scss
. Ikuramo amakarita menshi ya Sass _variables.scss
kugirango ikemure ikibazo aho kuvugurura ikarita yumwimerere bitakoreshejwe ku ikarita ya kabiri ibagura. Kurugero, ivugurura $theme-colors
ntabwo ryakoreshwaga kurindi karita yinsanganyamatsiko yashingiragaho $theme-colors
, kumena urufunguzo rwimikorere rwakazi. Muri make, Sass ifite aho igarukira aho bimaze gukoreshwa cyangwa ikarita isanzwe ikoreshwa , ntishobora kuvugururwa. Hano haribintu bisa nibihinduka bya CSS mugihe bikoreshwa muguhimba izindi CSS zihinduka.
Niyo mpanvu ibintu bihinduka muri Bootstrap bigomba kuza nyuma @import "functions"
, ariko mbere @import "variables"
nibindi bisigaye bitumizwa hanze. Kimwe nacyo kijyanye namakarita ya Sass - ugomba kurenga kubisanzwe mbere yuko bikoreshwa. Ikarita ikurikira yimuriwe ku gishya _maps.scss
:
$theme-colors-rgb
$utilities-colors
$utilities-text
$utilities-text-colors
$utilities-bg
$utilities-bg-colors
$negative-spacers
$gutters
Igikoresho cyawe Bootstrap CSS yubaka igomba noneho kugaragara nkiki hamwe namakarita atandukanye yatumijwe.
// Functions come first
@import "functions";
// Optional variable overrides here
+ $custom-color: #df711b;
+ $custom-theme-colors: (
+ "custom": $custom-color
+ );
// Variables come next
@import "variables";
+ // Optional Sass map overrides here
+ $theme-colors: map-merge($theme-colors, $custom-theme-colors);
+
+ // Followed by our default maps
+ @import "maps";
+
// Rest of our imports
@import "mixins";
@import "utilities";
@import "root";
@import "reboot";
// etc
Ibikorwa bishya
- Kwagura
font-weight
ibikorwa byingirakamaro kugirango ushiremo.fw-semibold
semibold yimyandikire. - Kwagura
border-radius
ibikorwa byingirakamaro kugirango ushiremo ibipimo bibiri bishya,.rounded-4
kandi.rounded-5
, kubindi bisobanuro.
Impinduka zinyongera
-
Yatangije
$enable-container-classes
uburyo bushya. - Noneho mugihe uhisemo imiterere ya CSS Grid igerageza,.container-*
amasomo azakomeza gukusanywa, keretse niba aya mahitamo yashizwehofalse
. Ibirimwo nabyo noneho bigumane indangagaciro zabo. -
Ibice bya Offcanvas ubu bifite itandukaniro ryitabira . Icyiciro cyumwimerere
.offcanvas
ntigihinduka - gihisha ibiri murwego rwo kureba. Kugirango bisubizwe, hindura iryo.offcanvas
shuri mubyiciro byose.offcanvas-{sm|md|lg|xl|xxl}
. -
Abatandukanya ameza meza ubu bahisemo. - Twakuyeho umubyimba kandi bigoye kurenga imipaka hagati yitsinda ryameza hanyuma tuyimurira mubyiciro utabishaka ushobora gusaba ,
.table-group-divider
. Reba imbonerahamwe ya docs kurugero. -
Scrollspy yongeye kwandikwa kugirango ukoreshe Intersection Observer API , bivuze ko utagikeneye gufunga ababyeyi ugereranije, gutesha agaciro
offset
config, nibindi byinshi. Reba ibyo washyize mubikorwa bya Scrollspy kugirango birusheho kuba byiza kandi bihamye muri nav yamuritse. -
Popovers hamwe nibikoresho byifashisha ubu CSS ihinduka. Impinduka zimwe za CSS zavuguruwe kuva kuri Sass bagenzi babo kugirango bagabanye umubare wibihinduka. Nkigisubizo, impinduka eshatu zateshejwe agaciro muri iri tangazo
$popover-arrow-color
:,$popover-arrow-outer-color
na$tooltip-arrow-color
. -
Wongeyeho
.text-bg-{color}
abafasha bashya. Aho gushiraho umuntu kugiti cye.text-*
nibikorwa.bg-*
, urashobora noneho gukoresha abafasha.text-bg-*
kugirango ushirehobackground-color
itandukaniro ryimberecolor
. -
Wongeyeho
.form-check-reverse
modifier kugirango uhindure urutonde rwibirango hamwe na agasanduku kagenzura / amaradiyo. -
Wongeyeho imirongo ihanamye yinkingi kumeza ukoresheje urwego rushya
.table-striped-columns
.
Kumurongo wuzuye wimpinduka , reba umushinga v5.2.0 kuri GitHub .
v5.1.0
-
Wongeyeho inkunga yubushakashatsi kuri CSS Grid imiterere . - Iki ni umurimo urimo gukorwa, kandi nturategurwa gukoreshwa, ariko urashobora guhitamo ibintu bishya ukoresheje Sass. Kugirango ubishoboze, uhagarike gride isanzwe, mugushiraho
$enable-grid-classes: false
kandi ushoboze CSS Grid mugushiraho$enable-cssgrid: true
. -
Kuvugurura navbars kugirango ushyigikire offcanvas. - Ongeraho ibishushanyo bya offcanvas muri navbar iyariyo yose hamwe
.navbar-expand-*
namasomo yitabira hamwe na marike ya offcanvas. -
Wongeyeho ibice bishya byumwanya . - Ibice bishya byacu, uburyo bwo gutanga ibibuza byigihe gito mu mwanya wibirimo bifatika kugirango bifashe kwerekana ko hari ikintu kigikorerwa kurubuga rwawe cyangwa porogaramu.
-
Gusenya plugin noneho ishyigikira gutambuka gutambitse . - Ongeraho
.collapse-horizontal
kugirango.collapse
usenyukewidth
aho kubaheight
. Irinde gushakisha amarangi mugushiraho amin-height
cyangwaheight
. -
Wongeyeho stack nshya hamwe nabahagaritse amategeko abafasha. - Koresha vuba vuba ibintu byinshi bya flexbox kugirango uhite ukora imiterere yihariye hamwe na stack . Hitamo muri horizontal (
.hstack
) na vertical (.vstack
) ibice. Ongeraho ibice bihagaritse bisa<hr>
nibintu hamwe nabafasha bashya.vr
. -
Wongeyeho ibishya bishya bya
:root
CSS. - Wongeyeho byinshi bishya bya CSS:root
kurwego rwo kugenzura<body>
imiterere. Ibindi biri mubikorwa, harimo murwego rwibikorwa byacu nibigize, ariko kuri ubu soma impinduka za CSS mugice cya Customize . -
Kuvugurura ibara ninyuma yibikorwa kugirango ukoreshe CSS ihinduka, hanyuma wongereho inyandiko nshya opacity hamwe ninyuma yibikorwa byingirakamaro . -
.text-*
hamwe.bg-*
nibikorwa byubu byubatswe hamwe na CSS ihindukargba()
nibiciro byamabara, bikwemerera guhitamo byoroshye ibikorwa byose hamwe nibikorwa bishya bya opacity. -
Wongeyeho ingero nshya zifatika zishingiye kwerekana uburyo bwo gutunganya ibice byacu. - Kurura witeguye gukoresha ibice byabugenewe hamwe nubundi buryo busanzwe bwo gushushanya hamwe ningero zacu nshya za Snippets . Harimo ibirenge , ibitonyanga , urutonde rwamatsinda , hamwe nuburyo .
-
Yakuweho imiterere idakoreshwa muburyo bwa popovers hamwe nibikoresho byifashishwa nkuko bikorwa na Popper gusa.
$tooltip-margin
yateshejwe agaciro kandi yashyizwenull
mubikorwa.
Urashaka amakuru menshi? Soma inyandiko ya v5.1.0.
Kwishingikiriza
- JQuery yataye.
- Kuzamurwa kuva Popper v1.x kuri Popper v2.x.
- Yasimbuye Libsass hamwe na Dart Sass nkuko icyegeranyo cya Sass cyatanzwe na Libsass cyateshejwe agaciro.
- Yimukiye muri Jekyll yerekeza Hugo kubaka ibyangombwa byacu
Inkunga ya mushakisha
- Yataye Internet Explorer 10 na 11
- Yataye Microsoft Edge <16 (Umurage Umurage)
- Firefox yataye <60
- Safari yataye <12
- Yataye iOS Safari <12
- Chrome yataye <60
Guhindura inyandiko
- Kongera gushushanya urupapuro rwambere, imiterere ya doc, na footer.
- Wongeyeho Parcelle nshya .
- Wongeyeho igice gishya cya Customize , usimbuze urupapuro rwa The4 rwa v4 , hamwe nibisobanuro bishya kuri Sass, amahitamo yimiterere yisi yose, gahunda yamabara, impinduka za CSS, nibindi byinshi.
- Ongera uhindure ibyangombwa byose mubice bishya , ugabanye ibiri mumapaji yibanze.
- Mu buryo busa nabwo, wavuguruye igice cya Layout , kugirango ubone ibintu bya gride neza.
- Izina ryitwa "Navs" urupapuro rwibigize kuri "Navs & Tabs".
- Izina ryahinduwe "Kugenzura" kuri "Kugenzura & amaradiyo".
- Ongera uhindure navbar hanyuma wongereho subnav nshya kugirango byoroshye kuzenguruka imbuga zacu na verisiyo ya docs.
- Wongeyeho clavier nshya ya shortcut kumwanya wo gushakisha : Ctrl + /.
Sass
-
Twacukuye ikarita isanzwe ya Sass ihuza kugirango byoroshye gukuraho indangagaciro zirenze. Wibuke ko ubu ugomba gusobanura indangagaciro zose mumakarita ya Sass nka
$theme-colors
. Reba uko wakemura amakarita ya Sass . -
KumenaGuhindura
color-yiq()
imikorere hamwe nibihinduka bijyanyecolor-contrast()
nkuko bitakiri bijyanye na YIQ ibara ryumwanya. Reba # 30168.$yiq-contrasted-threshold
ni izina$min-contrast-ratio
.$yiq-text-dark
na$yiq-text-light
Byahinduwe Kuri$color-contrast-dark
na$color-contrast-light
.
-
KumenaIkibazo cyibitangazamakuru bivanga ibipimo byahindutse kuburyo bwumvikana.
media-breakpoint-down()
ikoresha aho ihagarara ubwayo aho gukurikira (urugero,media-breakpoint-down(lg)
ahomedia-breakpoint-down(md)
kureba intego ntoya kurutalg
).- Mu buryo busa nabwo, ibipimo bya kabiri
media-breakpoint-between()
nabyo bikoresha aho bihagarara ubwabyo aho gukurikira (urugero,media-between(sm, lg)
ahomedia-breakpoint-between(sm, md)
intego zerekanwa hagatism
nalg
).
-
KumenaYakuweho imyandikire yimyandikire kandi
$enable-print-styles
irahinduka. Icapa ryerekana ibyiciro biracyari hafi. Reba # 28339 . -
KumenaYataye
color()
,theme-color()
nagray()
imikorere kugirango ashyigikire impinduka. Reba # 29083 . -
KumenaImikorere yahinduwe
theme-color-level()
kugirangocolor-level()
noneho yemere ibara ryose ushaka aho kuba$theme-color
amabara gusa. Reba # 29083 Witondere:color-level()
nyuma yaje kumanukav5.0.0-alpha3
. -
KumenaYahinduwe
$enable-prefers-reduced-motion-media-query
kandi$enable-pointer-cursor-for-buttons
kuri$enable-reduced-motion
no$enable-button-pointers
kubugufi. -
KumenaYakuyeho
bg-gradient-variant()
ivanga. Koresha urwego.bg-gradient
kugirango wongere gradients mubintu aho kuba.bg-gradient-*
ibyiciro byakozwe. -
Kumena Yakuweho kuvanga mbere:
hover
,,, nahover-focus
_plain-hover-focus
hover-focus-active
float()
form-control-mixin()
nav-divider()
retina-img()
text-hide()
(yanataye icyiciro cy'ingirakamaro bifitanye isano,.text-hide
)visibility()
form-control-focus()
-
Kumena
scale-color()
Imikorere yahinduweshift-color()
kugirango wirinde kugongana na Sass wenyine ibikorwa byo gupima amabara. -
box-shadow
kuvanga noneho kwemereranull
indangagaciro no kugabanuka kubitekerezonone
byinshi. Reba # 30394 . -
Kuvanga ubu
border-radius()
bifite agaciro gasanzwe.
Sisitemu y'amabara
-
Sisitemu yamabara yakoranye
color-level()
kandi$theme-color-interval
yakuweho kugirango ashyigikire sisitemu nshya. Byoselighten()
nibikorwadarken()
muri codebase yacu byasimbuwetint-color()
nashade-color()
. Iyi mikorere izavanga ibara numweru cyangwa umukara aho guhindura urumuri rwinshi. Ubushakeshift-color()
bushobora guhindura ibara cyangwa kugicucu bitewe nuburyo ibipimo byuburemere ari byiza cyangwa bibi. Reba # 30622 kugirango ubone ibisobanuro birambuye. -
Wongeyeho amabara mashya nigicucu kuri buri bara, utanga amabara icyenda atandukanye kuri buri bara shingiro, nkibintu bishya bya Sass.
-
Kunoza ibara ritandukanye. Ikigereranyo cyamabara atandukanye kuva 3: 1 kugeza 4.5: 1 no kuvugurura amabara yubururu, icyatsi, cyan, nijimye kugirango WCAG 2.1 AA itandukanye. Hindura kandi ibara ritandukanya ibara kuva
$gray-900
kuri$black
. -
Kugirango dushyigikire sisitemu y'amabara, twongeyeho imigenzo mishya
tint-color()
n'imikorereshade-color()
yo kuvanga amabara uko bikwiye.
Kuvugurura
-
Ibice bishya! Wongeyeho ibice bishya
xxl
kuri1400px
no hejuru. Nta gihinduka kubindi bice byose. -
Amazi meza. Imiyoboro ubu yashyizwe muri rems, kandi iragufi kuruta v4 (
1.5rem
, cyangwa hafi24px
, hepfo kuva30px
). Ibi bihuza imiyoboro ya sisitemu ya sisitemu hamwe nibikorwa byacu byo gutandukanya.- Wongeyeho ibyiciro bishya byamazi (
.g-*
,,.gx-*
na.gy-*
) kugirango ugenzure utambitse / uhagaritse imyanda, utambitse utambitse, hamwe nu muyoboro uhagaze. - KumenaYahinduwe
.no-gutters
kugirango.g-0
ahuze ibikorwa bishya byingirakamaro.
- Wongeyeho ibyiciro bishya byamazi (
-
Inkingi ntizikurikizwa
position: relative
, urashobora rero kongeramo.position-relative
ibintu bimwe kugirango ugarure iyo myitwarire. -
KumenaYahagaritse
.order-*
amasomo menshi yakunze kugenda adakoreshwa. Ubu turatanga gusa.order-1
hanze.order-5
yisanduku. -
KumenaKureka
.media
ibice nkuko bishobora kwigana byoroshye nibikorwa byingirakamaro. Reba # 28265 nurupapuro rwingirakamaro rwa flex kurugero . -
Kumena
bootstrap-grid.css
ubu ikoreshwa gusabox-sizing: border-box
kumurongo aho kugirango usubize isi-agasanduku. Ubu buryo, imiyoboro ya grid irashobora gukoreshwa ahantu henshi nta nkomyi. -
$enable-grid-classes
ntagishobora guhagarika ibisekuru byamasomo ya kontineri. Reba # 29146. -
Yavuguruye
make-col
ivanga kugirango asubiremo inkingi zingana nta bunini bwagenwe.
Ibirimo, Reboot, nibindi
-
RFS ishoboye gukora byanze bikunze. Imitwe ukoresheje
font-size()
mixin izahita ihindurafont-size
igipimo cyayo hamwe no kureba. Iyi mikorere yabanje guhitamo hamwe na v4. -
KumenaKuvugurura imyandikire yacu yerekana kugirango dusimbuze
$display-*
impinduka zacu hamwe$display-font-sizes
nikarita ya Sass.$display-*-weight
Kuraho kandi impinduka zumuntu kugiti cye$display-font-weight
kandi zahinduwefont-size
s. -
Wongeyeho bibiri bishya
.display-*
imitwe ingana,.display-5
na.display-6
. -
Ihuza ryatsindagirijwe muburyo budasanzwe (ntabwo ari kuri hover gusa), keretse niba bigize ibice byihariye.
-
Kuvugurura imbonerahamwe kugirango uhindure uburyo bwabo kandi ubyubake hamwe na CSS ihinduka kugirango igenzure neza imyandikire.
-
KumenaImbonerahamwe yatondekanye ntabwo izungura imiterere.
-
Kumena
.thead-light
kandi.thead-dark
baramanuwe bashyigikira.table-*
ibyiciro bitandukanye bishobora gukoreshwa kubintu byose byameza (thead
,,, natbody
, ) .tfoot
tr
th
td
-
KumenaIvanga
table-row-variant()
ryahinduwetable-variant()
kandi ryemera ibipimo 2 gusa:$color
(izina ryamabara) na$value
(kode yamabara). Ibara ryumupaka namabara yimvugo ihita ibarwa hashingiwe kumeza yibintu bihinduka. -
Gutandukanya imbonerahamwe ya selile padding ihinduka muri
-y
na-x
. -
KumenaAmashuri yataye
.pre-scrollable
. Reba # 29135 -
Kumena
.text-*
ibikorwa ntabwo byongera hover no kwibanda kuri reta ukundi..link-*
amasomo y'abafasha arashobora gukoreshwa aho. Reba # 29267 -
KumenaAmashuri yataye
.text-justify
. Reba # 29793 -
Kumena
<hr>
ibice noneho koreshaheight
ahoborder
kugirango ushyigikire nezasize
ikiranga. Ibi kandi bifasha gukoresha ibikoresho bya padding kugirango ukore ibice byinshi (urugero,<hr class="py-1">
). -
Ongera usubire gutambuka
padding-left
kuri horizontal<ul>
na<ol>
element kuva mushakisha isanzwe40px
kuri2rem
. -
Wongeyeho
$enable-smooth-scroll
, ikoreshwascroll-behavior: smooth
kwisi yose-usibye kubakoresha gusaba kugabanywa binyuzeprefers-reduced-motion
mubibazo byitangazamakuru. Reba # 31877
RTL
- Icyerekezo gitambitse cyihariye gihinduka, ibikorwa, hamwe na mixin byose byahinduwe kugirango bikoreshe ibintu byumvikana nkibiboneka mumiterere ya flexbox - urugero,
start
noend
mu mwanya waleft
naright
.
Ifishi
-
Wongeyeho impapuro nshya zireremba! Twazamuye ibirango bya Floating labels kurugero rushyigikiwe byuzuye. Reba urupapuro rushya rwa Floating labels page.
-
Kumena Guhuriza hamwe kavukire hamwe nibintu byabigenewe. Kugenzura agasanduku, amaradiyo, guhitamo, nibindi byinjira byari bifite ibyiciro gakondo nibisanzwe muri v4 byahujwe. Noneho hafi ya fomu yibintu byose biramenyerewe rwose, ibyinshi bidakenewe HTML yihariye.
.custom-control.custom-checkbox
ni ubu.form-check
..custom-control.custom-custom-radio
ni ubu.form-check
..custom-control.custom-switch
ni ubu.form-check.form-switch
..custom-select
ni ubu.form-select
..custom-file
kandi.form-file
byasimbuwe nuburyo bwihariye hejuru.form-control
..custom-range
ni ubu.form-range
.- Yataye kavukire
.form-control-file
kandi.form-control-range
.
-
KumenaYataye
.input-group-append
kandi.input-group-prepend
. Urashobora noneho kongeramo buto gusa.input-group-text
nkabana bayobora mumatsinda yinjiza. -
Umwanya muremure wabuze umupaka radiyo kumurongo winjiza hamwe no kwemeza ibitekerezo byanyuma bikosorwa wongeyeho
.has-validation
urwego rwinyongera mumatsinda yinjiza hamwe no kwemeza. -
Kumena Kureka ifishi yihariye imiterere ya sisitemu ya grid sisitemu. Koresha grid hamwe nibikorwa byacu aho
.form-group
,,.form-row
cyangwa.form-inline
. -
KumenaIbirango byerekana
.form-label
. -
Kumena
.form-text
ntagishoboradisplay
gushiraho, kukwemerera gukora inline cyangwa guhagarika inyandiko ifasha nkuko ubyifuza uhinduye gusa element ya HTML. -
Ifishi igenzura ntigikoreshwa gukoreshwa
height
mugihe bishoboka, ahubwo ikoherezamin-height
kunoza imikorere no guhuza nibindi bice. -
Kwemeza amashusho ntibikoreshwa kuri
<select>
s hamwemultiple
. -
Inkomoko yatunganijwe Sass dosiye munsi
scss/forms/
, harimo kwinjiza amatsinda yuburyo.
Ibigize
- Indangagaciro zihuriweho
padding
kubimenyesha, imigati, amakarita, ibitonyanga, urutonde rwamatsinda, modal, popovers, hamwe nibikoresho byifashishwa kugirango duhindure ibyo duhindura$spacer
. Reba # 30564 .
Amasezerano
- Wongeyeho ibice bishya .
Imenyesha
-
Imenyesha ubu rifite ingero hamwe namashusho .
-
Yakuweho uburyo bwihariye bwa
<hr>
s muri buri menyesha kuva basanzwe bakoreshacurrentColor
.
Ikarita
-
KumenaYataye
.badge-*
ibyiciro byose byamabara kubikorwa byinyuma (urugero, koresha.bg-primary
aho.badge-primary
). -
KumenaYataye
.badge-pill
- koresha.rounded-pill
akamaro aho. -
KumenaYakuweho hover hamwe nibitekerezo byuburyo
<a>
hamwe<button>
nibintu. -
Kwiyongera kudasanzwe padding ya badges kuva
.25em
/.5em
kugeza.35em
/.65em
.
Imitsima
-
Kworoshya isura isanzwe yimigati ikuraho
padding
,background-color
naborder-radius
. -
Wongeyeho imitungo mishya ya CSS
--bs-breadcrumb-divider
yo kwihitiramo byoroshye bitabaye ngombwa ko usubiramo CSS.
Utubuto
-
Kumena Kanda buto , hamwe na agasanduku cyangwa amaradiyo, ntibigisaba JavaScript kandi ufite ibimenyetso bishya. Ntabwo tugikeneye ibintu bipfunyika, ongeraho
.btn-check
kuri<input>
, kandi ubihuze.btn
namasomo ayo ari yo yose kuri<label>
. Reba # 30650 . Inyandiko zibi zimutse kuva kurupapuro rwa Button kurupapuro rushya. -
Kumena Yataye
.btn-block
kubikorwa byingirakamaro. Aho kugirango ukoreshe.btn-block
kuri.btn
, funga buto yawe hamwe.d-grid
ningirakamaro.gap-*
kugirango ubashyire umwanya nkuko bikenewe. Hindura kumasomo yitabira kugirango arusheho kubagenzura. Soma inyandiko zingero zimwe. -
Yavuguruye ibyacu
button-variant()
nabutton-outline-variant()
mixins kugirango dushyigikire ibipimo byinyongera. -
Kuvugurura utubuto kugirango tumenye itandukaniro kuri hover na leta ikora.
-
Utubuto twahagaritswe ubu dufite
pointer-events: none;
.
Ikarita
-
KumenaYataye kuruhande
.card-deck
rwa gride yacu. Wizike amakarita yawe mumasomo yinkingi hanyuma ongeraho ikintu cyababyeyi.row-cols-*
kugirango wongere ukore amakarita (ariko hamwe nubugenzuzi burenze guhuza). -
KumenaYataye
.card-columns
ashyigikira Masonry. Reba # 28922 . -
KumenaYasimbuje
.card
akabariro gashingiye hamwe nibintu bishya bya Acordion .
Carousel
-
Wongeyeho
.carousel-dark
variant nshya kumyandiko yijimye, igenzura, nibipimo (bikomeye kumurongo woroshye). -
Amashusho ya chevron yasimbujwe karuseli igenzura hamwe na SVGs nshya kuva muri Bootstrap .
Funga buto
-
KumenaYahinduwe
.close
kugirango.btn-close
izina rito risanzwe. -
Funga buto noneho koresha
background-image
(yashyizwemo SVG) aho kuba×
muri HTML, yemerera kwihitiramo byoroshye bitabaye ngombwa ko ukoraho ikimenyetso cyawe. -
Wongeyeho
.btn-close-white
variant nshya ikoreshafilter: invert(1)
kugirango ishoboze gutandukanya itandukaniro ryo kwirukana amashusho kuruhande rwijimye.
Gusenyuka
- Yakuweho imizingo ya ankoring ya bordion.
Ibitonyanga
-
Wongeyeho impinduka nshya
.dropdown-menu-dark
hamwe nibihinduka bijyanye-kubisabwa umwijima wamanutse. -
Wongeyeho impinduka nshya kuri
$dropdown-padding-x
. -
Umwijima wamanutse kugirango ugabanye itandukaniro.
-
KumenaIbyabaye byose kubitonyanga noneho bikururwa kuri buto yo kumanura hanyuma hanyuma ikabyara kugeza kubintu byababyeyi.
-
Ibitonyanga Ibikurikira ubu bifite
data-bs-popper="static"
ikiranga gushiraho mugihe umwanya wibitonyanga bihagaze, cyangwa ibitonyanga biri mumurongo. Ibi byongeweho na JavaScript yacu kandi bidufasha gukoresha imiterere yimyanya yimyitozo itabangamiye umwanya wa Popper. -
KumenaAmahitamo yataye
flip
kumanura plugin kugirango ashyigikire kavukire ya Popper. Urashobora noneho guhagarika imyitwarire yo guhinduranya unyuze kumurongo wubusa kugirangofallbackPlacements
uhitemo flip modifier. -
Ibitonyanga Ibitonyanga birashobora gukanda hamwe nuburyo bushya
autoClose
bwo gukemura imyitwarire yimodoka . Urashobora gukoresha ubu buryo kugirango wemere gukanda imbere cyangwa hanze ya menu yamanutse kugirango ikoreshwe. -
Ibitonyanga noneho bishyigikira
.dropdown-item
s bipfunyitse muri<li>
s.
Jumbotron
- KumenaKureka ibice bya jumbotron nkuko bishobora kwiganwa hamwe nibikorwa. Reba urugero rwacu rushya rwa Jumbotron kuri demo.
Andika itsinda
- Wongeyeho impinduka nshya kurutonde rwamatsinda
.list-group-numbered
.
Amato na tabs
- Wongeyeho
null
impinduka nshya kuri ,,,font-size
no ku cyiciro .font-weight
color
:hover
color
.nav-link
Navbars
- KumenaNavbars ubu isaba kontineri imbere (kugirango byoroshe cyane ibisabwa byumwanya hamwe na CSS isabwa).
- KumenaIcyiciro
.active
ntigishobora gukoreshwa kuri.nav-item
s, kigomba gukoreshwa kuri.nav-link
s.
Offcanvas
- Wongeyeho ibice bishya bya offcanvas .
Pagination
-
Ihuza rya pagination ubu rifite uburyo bwo guhinduranya
margin-left
buzengurutse impande zose iyo zitandukanijwe. -
Wongeyeho
transition
s kumurongo wo guhuza.
Amashanyarazi
-
KumenaYahinduwe muburyo busanzwe
.arrow
bwa.popover-arrow
popover. -
Izina ryahinduwe
whiteList
kuriallowList
.
Abazunguruka
-
Abazunguruka ubu bubaha
prefers-reduced-motion: reduce
mugutinda animasiyo. Reba # 31882 . -
Kunoza kuzunguruka guhindagurika.
Toost
-
Toost irashobora guhagarikwa muri a
.toast-container
hamwe nubufasha bwibikorwa byingenzi . -
Yahinduwe toast isanzwe igihe cyamasegonda 5.
-
Yakuwe
overflow: hidden
muri toast hanyuma asimbuzwaborder-radius
s bikwiye nibikorwacalc()
.
Ibikoresho
-
KumenaYahinduwe
.arrow
kuri.tooltip-arrow
muburyo busanzwe bwibikoresho. -
KumenaMburabuzi Agaciro Kuri i
fallbackPlacements
Yahinduwe Kuri['top', 'right', 'bottom', 'left']
Gushyira Byiza Ibintu Byiza. -
KumenaIzina ryahinduwe
whiteList
kuriallowList
.
Ibikorwa
-
KumenaYahinduye ibikorwa byinshi kugirango ukoreshe amazina yumutungo wumvikana aho gukoresha amazina yicyerekezo wongeyeho inkunga ya RTL:
- Yahinduwe
.left-*
kandi.right-*
kuri.start-*
na.end-*
. - Yahinduwe
.float-left
kandi.float-right
kuri.float-start
na.float-end
. - Yahinduwe
.border-left
kandi.border-right
kuri.border-start
na.border-end
. - Yahinduwe
.rounded-left
kandi.rounded-right
kuri.rounded-start
na.rounded-end
. - Yahinduwe
.ml-*
kandi.mr-*
kuri.ms-*
na.me-*
. - Yahinduwe
.pl-*
kandi.pr-*
kuri.ps-*
na.pe-*
. - Yahinduwe
.text-left
kandi.text-right
kuri.text-start
na.text-end
.
- Yahinduwe
-
KumenaYahagaritse imipaka itari nziza.
-
Wongeyeho ibyiciro bishya
.bg-body
kugirango ushireho byihuse<body>
imiterere yinyongera. -
Wongeyeho imyanya mishya yingirakamaro kuri
top
,,,right
nabottom
.left
Indangagaciro zirimo0
,50%
kandi100%
kuri buri mutungo. -
Wongeyeho ibishya
.translate-middle-x
&.translate-middle-y
ibikorwa byingirakamaro kuri horizontalale cyangwa uhagaritse hagati ya absolute / ihagaze neza. -
Wongeyeho
border-width
ibikorwa bishya . -
KumenaYahinduwe
.text-monospace
kuri.font-monospace
. -
KumenaYakuweho
.text-hide
kuko nuburyo bwa kera bwo guhisha inyandiko itagomba gukoreshwa ukundi. -
Wongeyeho
.fs-*
ibikorwafont-size
byingirakamaro (hamwe na RFS ishoboye). Ibi bifashisha igipimo kimwe na HTML isanzwe (1-6, nini kugeza nto), kandi irashobora guhindurwa hakoreshejwe ikarita ya Sass. -
Kumena
.font-weight-*
Ibikorwa byahinduwe byingirakamaro nko kubugufi.fw-*
no guhoraho. -
Kumena
.font-style-*
Ibikorwa byahinduwe byingirakamaro nko kubugufi.fst-*
no guhoraho. -
Wongeyeho
.d-grid
kwerekana ibikorwa byingenzi nibikorwa bishyagap
(.gap
) kuri CSS Grid na flexbox imiterere. -
KumenaYakuweho
.rounded-sm
kandirounded-lg
, kandi yatangije igipimo gishya cyamasomo,.rounded-0
kuri.rounded-3
. Reba # 31687 . -
Wongeyeho ibikorwa bishya
line-height
:.lh-1
,,.lh-sm
na . Reba hano ..lh-base
.lh-lg
-
Yimuye
.d-none
akamaro muri CSS yacu kugirango itange uburemere burenze kubindi bikoresho byerekanwa. -
Yaguye
.visually-hidden-focusable
umufasha kugirango akore no kuri kontineri, ukoresheje:focus-within
.
Abafasha
-
Kumena Abafasha bashubije bahinduwe bahinduwe bafasha kugereranya bafite amazina mashya yo mucyiciro hamwe nimyitwarire myiza, kimwe na CSS ihinduka.
- Amasomo yahinduwe kugirango ahindurwe
by
muburyox
bugereranijwe. Kurugero,.ratio-16by9
ni.ratio-16x9
. - Twahagaritse ibice
.embed-responsive-item
hamwe nitsinda ryabatoranijwe kugirango dushyigikire byoroshye.ratio > *
. Ntakindi cyiciro gikenewe, kandi umufasha wikigereranyo ubu akorana nibintu byose bya HTML. - Ikarita ya
$embed-responsive-aspect-ratios
Sass yahinduwe izina$aspect-ratios
kandi indangagaciro zayo zoroshe gushyiramo izina ryurwego nijanishakey: value
nkibiri. - Impinduka za CSS ubu zakozwe kandi zirimo buri gaciro ku ikarita ya Sass. Hindura
--bs-aspect-ratio
impinduka kuri.ratio
kugirango ukore igereranyo icyo aricyo cyose .
- Amasomo yahinduwe kugirango ahindurwe
-
Kumena Amasomo ya "Screen Reader" ubu ni amasomo "yihishe" .
- Yahinduye dosiye ya Sass kuva
scss/helpers/_screenreaders.scss
kuriscss/helpers/_visually-hidden.scss
- Yahinduwe
.sr-only
kandi.sr-only-focusable
kuri.visually-hidden
na.visually-hidden-focusable
- Yahinduwe
sr-only()
kandisr-only-focusable()
avanga kurivisually-hidden()
navisually-hidden-focusable()
.
- Yahinduye dosiye ya Sass kuva
-
bootstrap-utilities.css
ubu harimo n'abadufasha. Abafasha ntibakeneye gutumizwa mumazu yubaka.
JavaScript
-
Kureka jQuery kwishingikiriza no kwandika amacomeka kugirango abe muri JavaScript isanzwe.
-
KumenaIbiranga amakuru kuri plugin zose za JavaScript ubu zashyizwe kumazina kugirango zifashe gutandukanya imikorere ya Bootstrap nabandi bantu hamwe na code yawe. Kurugero, dukoresha
data-bs-toggle
ahodata-toggle
. -
Amacomeka yose arashobora noneho kwemera guhitamo CSS nkimpaka yambere. Urashobora gutambutsa ikintu cya DOM cyangwa uwatoranije CSS yemewe kugirango ukore urugero rushya rwa plugin:
const modal = new bootstrap.Modal('#myModal') const dropdown = new bootstrap.Dropdown('[data-bs-toggle="dropdown"]')
-
popperConfig
Birashobora gutambuka nkigikorwa cyemera Bootstrap isanzwe ya Popper config nkimpaka, kugirango ubashe guhuza iboneza ryambere muburyo bwawe. Irasaba kumanuka, popovers, hamwe nibikoresho. -
Mburabuzi Agaciro kuri i
fallbackPlacements
yahinduwe kugirango['top', 'right', 'bottom', 'left']
ishyirwe neza kubintu bya Popper. Irasaba kumanuka, popovers, hamwe nibikoresho. -
Yakuweho gutsindagira kumurongo muburyo rusange buhagaze nka
_getInstance()
→getInstance()
.