Ukufudukela kwi-v5
Landa kwaye ujonge kwakhona utshintsho kwiifayile zomthombo weBootstrap, uxwebhu, kunye namacandelo okukunceda ufuduke ukusuka kwi-v4 ukuya kwi-v5.
v5.2.0
Uyilo oluhlaziyiweyo
I-Bootstrap v5.2.0 ibonakalisa uhlaziyo loyilo oluchuliweyo kumacandelo ambalwa kunye neepropathi kuyo yonke iprojekthi, ngakumbi border-radius
ngamaxabiso asulungekileyo kumaqhosha kunye nolawulo lwefom . Amaxwebhu ethu nawo ahlaziywe ngephepha lasekhaya elitsha, uyilo olulula lwamaxwebhu olungasawohlokiyo amacandelo ebar esecaleni, kunye nemizekelo ebalaseleyo yee- Icons zeBootstrap .
Iinguqu ezininzi zeCSS
Sihlaziye onke amacandelo ethu ukuze sisebenzise izinto eziguquguqukayo zeCSS. Ngelixa i-Sass isaxhasa yonke into, icandelo ngalinye liye lahlaziywa ukuze libandakanye iinguqu ze-CSS kwiiklasi zesiseko secandelo (umzekelo, .btn
), ukuvumela ukulungelelanisa ixesha lokwenyani leBootstrap. Kukhupho olulandelayo, siya kuqhubeka nokwandisa ukusetyenziswa kwethu kwezinto eziguquguqukayo zeCSS kuyilo lwethu, iifom, abancedisi, kunye nezinto eziluncedo. Funda ngakumbi malunga noguqulo lweCSS kwicandelo ngalinye kumaphepha abo amaxwebhu.
Ukusetyenziswa kwethu okuguquguqukayo kweCSS kuya kuba kungaphelelanga kude kube yiBootstrap 6. Ngelixa singathanda ukuphumeza ezi zinto kwibhodi yonke, ziqhuba umngcipheko wokubangela utshintsho oluqhawukayo. Umzekelo, ukuseta $alert-border-width: var(--bs-border-width)
kwikhowudi yethu yomthombo kwaphula i-Sass enokubakho kwikhowudi yakho ukuba ubusenza $alert-border-width * 2
ngesizathu esithile.
Ngokunjalo, naphi na apho kunokwenzeka, siya kuqhubeka sityhalela phambili kwizinto eziguquguqukayo ze-CSS, kodwa nceda uqaphele ukuphunyezwa kwethu kunokuthintelwa kancinci kwi-v5.
Entsha_maps.scss
I-Bootstrap v5.2.0 yazisa ifayile yeSass entsha nge _maps.scss
. Ikhupha iimephu ezininzi ze-Sass ukusuka _variables.scss
ukulungisa umba apho uhlaziyo kwimephu yoqobo lungazange lusetyenziswe kwiimephu zesibini ezandisayo. Umzekelo, uhlaziyo $theme-colors
aluzange lusetyenziswe kwezinye iimephu zomxholo ezixhomekeke $theme-colors
, ukwaphula ukuhanjiswa komsebenzi okuphambili. Ngamafutshane, i-Sass inomda apho xa inguqu engagqibekanga okanye imephu isetyenzisiwe , ayinakuhlaziywa. Kukho ukusilela okufanayo kunye neenguqu zeCSS xa zisetyenziselwa ukuqamba ezinye iinguqu zeCSS.
Kungenxa yoko le nto uhlengahlengiso oluguquguqukayo kwi-Bootstrap kufuneka luze emva koko @import "functions"
, kodwa ngaphambili @import "variables"
kunye nezinye izinto zethu zokungenisa elizweni. Okufanayo kuyasebenza kwiimephu zakwa-Sass- kufuneka ubhale ngaphezulu izinto ezingagqibekanga phambi kokuba zisetyenziswe. Ezi mephu zilandelayo zisiwe kwentsha _maps.scss
:
$theme-colors-rgb
$utilities-colors
$utilities-text
$utilities-text-colors
$utilities-bg
$utilities-bg-colors
$negative-spacers
$gutters
Ulwakhiwo lwakho lwe-Bootstrap ye-CSS ngoku kufuneka lujonge into enje ngokungenisa iimephu ezahlukeneyo.
// 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
Izinto ezintsha eziluncedo
font-weight
Izinto eziluncedo ezandisiweyo ukubandakanya.fw-semibold
iifonti ezingqindilili kancinci.border-radius
Izinto eziluncedo ezandisiweyo ukubandakanya iisayizi ezimbini ezintsha,.rounded-4
kunye.rounded-5
nokhetho oluninzi.
Utshintsho olongezelelweyo
-
Yaziswa ngenketho entsha
$enable-container-classes
. — Ngoku xa ungena kwimifuniselo yoyilo lweGridi yeCSS,.container-*
iiklasi zisaza kuqokelelwa, ngaphandle kokuba olu khetho lusetelwe kufalse
. Izikhongozeli nazo ngoku zigcina amaxabiso azo egutter. -
Icandelo le-Offcanvas ngoku lineenguqu eziphendulayo . Iklasi yokuqala
.offcanvas
ihlala ingatshintshi-ifihla umxholo kuzo zonke iindawo zokujonga. Ukwenza ukuba iphendule, tshintsha loo.offcanvas
klasi kuyo nayiphi na.offcanvas-{sm|md|lg|xl|xxl}
iklasi. -
Izahluli zetafile ezishinyeneyo ngoku zikhethe ukungena. — Siwususile ongqindilili kwaye kunzima kakhulu ukuwubhala ngaphezulu umda phakathi kwamaqela etafile kwaye sawuhambisa kwiklasi yokhetho onokuthi uyifake,
.table-group-divider
. Jonga amaxwebhu etafile umzekelo. -
I-Scrollspy ibhalwe ngokutsha ukusebenzisa i-API ye-Intersection Observer , nto leyo ethetha ukuba
offset
, kunye nokunye. Jonga uphumezo lwakho lweScrollspy ukuba luchaneke ngakumbi kwaye lungaguquguquki kuphawu lwabo lwe-nav. -
Iipopovers kunye netooltips ngoku zisebenzisa iCSS variables. Ezinye iinguqu zeCSS ziye zahlaziywa ukusuka koogxa babo beSass ukunciphisa inani leenguqu. Ngenxa yoko, izinto ezintathu eziguquguqukayo ziye zayekiswa kolu kukhutshwa:
$popover-arrow-color
,$popover-arrow-outer-color
, kunye$tooltip-arrow-color
. -
Kongezwe
.text-bg-{color}
abancedisi abatsha. Endaweni yokuseta umntu.text-*
kunye.bg-*
nezinto eziluncedo, ngoku unokusebenzisa abancedisi.text-bg-*
ukusetabackground-color
ngokuthelekisa umphambilicolor
. -
Kongezwe
.form-check-reverse
isilungisi ukuguqula ulandelelwano lweelebhile kunye neebhokisi zokukhangela ezihambelanayo/nonomathotholo. -
Kongezwe inkxaso yeekholamu ezinemigca kwiitafile kusetyenziswa
.table-striped-columns
iklasi entsha.
Uluhlu olupheleleyo lweenguqu, bona iprojekthi ye-v5.2.0 kwi-GitHub .
v5.1.0
-
Inkxaso yovavanyo eyongeziweyo yoyilo lwegridi yeCSS . - Lo ngumsebenzi oqhubekayo, kwaye awukakulungeli ukusetyenziswa kwemveliso, kodwa ungangena kwinqaku elitsha nge-Sass. Ukuyenza isebenze, khubaza igridi engagqibekanga, ngokucwangcisa
$enable-grid-classes: false
kwaye uvule iCSS Grid ngokucwangcisa$enable-cssgrid: true
. -
Iinavbar ezihlaziyiweyo ukuxhasa i-offcanvas. -Yongeza iidrowa ze-offcanvas kuyo nayiphi na i-
.navbar-expand-*
navbar eneeklasi eziphendulayo kunye ne-offcanvas markup. -
Kongezwe into entsha yesibambi- ndawo . - Icandelo lethu elitsha, indlela yokubonelela ngeebhloko zexeshana endaweni yomxholo wokwenyani ukunceda ukubonisa ukuba kukho into esalayisha kwindawo yakho okanye kwi-app.
-
Iplagi yokugoqa ngoku ixhasa ukudilika okuthe tye . - Yongeza
.collapse-horizontal
kweyakho.collapse
ukudilikawidth
endaweni yeheight
. Kuphephe ukupeyinta kwakhona isikhangeli ngokusetamin-height
okanyeheight
. -
Kongezwe istaki esitsha kunye nabancedisi bomthetho othe nkqo. -Faka ngokukhawuleza iipropathi ezininzi ze-flexbox ukwenza ngokukhawuleza uyilo lwesiko kunye nezitaki . Khetha ukusuka kokuthe tye (
.hstack
) kunye nokuthe nkqo (.vstack
) izitaki. Yongeza izahluli ezithe nkqo ezifanayo nezinto<hr>
ezinabancedi abatsha.vr
. -
Kongezwe iinguqu ezintsha
:root
zeCSS zehlabathi. -Yongeza iinguqu ezininzi ezintsha zeCSS:root
kwinqanaba lokulawula<body>
izimbo. Okuninzi kusemisebenzini, kubandakanywa kuzo zonke izinto esizisebenzisayo kunye namacandelo, kodwa okwangoku funda iinguqu ze-CSS kwicandelo le-Lungisa . -
Umbala ogqityiweyo kunye nezinto eziluncedo ezingasemva ukuze kusetyenziswe izinto eziguquguqukayo zeCSS, kwaye kongeze ukukhanya okutsha kokubhaliweyo kunye nezixhobo zokungafihli okungasemva. -
.text-*
kunye.bg-*
nezinto eziluncedo ngoku zakhiwe ngezinto eziguquguqukayo zeCSS kunyergba()
namaxabiso ombala, ekuvumela ukuba wenze ngokwezifiso naziphi na izinto eziluncedo ngezinto ezintsha zokungafihli. -
Kongezwe imizekelo emitsha yesnippet esekwe ekuboniseni indlela yokwenza izinto zethu ngokwezifiso. - Tsala ulungele ukusebenzisa amacandelo alungiselelweyo kunye nezinye iipateni zoyilo eziqhelekileyo ngemizekelo yethu emitsha yeeSnippets . Iquka okubhalwe phantsi , okwehlayo , amaqela oluhlu , kunye neendlela .
-
Izitayile zokumisa ezisusiweyo ezingasetyenziswanga kwiipopovers kunye netooltips njengoko ezi ziphathwa kuphela nguPopper.
$tooltip-margin
iyekisiwe kwaye imiselwenull
kwinkqubo.
Ngaba ufuna ulwazi oluninzi? Funda iposi yebhlog ye-v5.1.0.
Ukuxhomekeka
- Ilahliwe i-jQuery.
- Iphuculwe ukusuka kwiPopper v1.x ukuya kwiPopper v2.x.
- Kutshintshwe i-Libsass nge-Dart Sass njengoko umqambi wethu we-Sass onikwe i-Libsass iye yarhoxiswa.
- Wafuduka e-Jekyll waya eHugo ukuze sakhe amaxwebhu ethu
Inkxaso yebhrawuza
- Yehla i-Internet Explorer 10 kunye ne-11
- Iwisiwe iMicrosoft Edge < 16 (Legacy Edge)
- IFirefox iwile <60
- I-Safari yehlisiwe <12
- Iwiswe iOS Safari <12
- IChrome iwisiwe <60
Utshintsho lwamaxwebhu
- Iphepha lasekhaya eliyilwe ngokutsha, uyilo lwamaxwebhu, kunye nekhasi elisezantsi.
- Kongezwe isikhokelo esitsha sePasela .
- Kongezwe icandelo elitsha le-Customize , ibuyisela i-v4 yephepha le-Theming , kunye neenkcukacha ezintsha kwi-Sass, iinketho zokucwangciswa kwehlabathi jikelele, izikimu zemibala, ii-CSS variables, kunye nokunye.
- Ulungelelaniswa ngokutsha onke amaxwebhu efom kwicandelo elitsha leeFom , ukwahlula umxholo kumaphepha agxininise ngakumbi.
- Ngokufanayo, ihlaziywe icandelo loYilo , ukwenza igridi isiqulatho ngokucacileyo ngakumbi.
- Ithiywe ngokutsha "I-Navs" yecandelo lephepha ukuya kwi-"Navs & Tabs".
- Lithiywe ngokutsha "Iitsheki" iphepha ukuya ku "Iitshekhi kunye nonomathotholo".
- Uyilwe ngokutsha i-navbar kwaye wongeza i-subnav entsha ukwenza kube lula ukujikeleza iisayithi zethu kunye neenguqulelo zamaxwebhu.
- Kongezwe isinqumli esitsha sebhodi yezitshixo kwindawo yokukhangela: Ctrl + /.
Sass
-
Siluyekile udibaniso lwemaphu ye-Sass ukuze kube lula ukususa amaxabiso angafunekiyo. Gcina ukhumbula ukuba ngoku kufuneka uchaze onke amaxabiso kwiimephu zeSass njenge
$theme-colors
. Jonga indlela yokujongana neemephu zakwaSass . -
UkuqhawulaUmsebenzi othiywe ngokutsha
color-yiq()
kunye noguquko olunxulumeneyocolor-contrast()
njengoko ungasanxulumananga nesithuba sombala we-YIQ. Bona #30168.$yiq-contrasted-threshold
ithiywe kwakhona ku$min-contrast-ratio
.$yiq-text-dark
kwaye$yiq-text-light
ngokulandelelana zithiywe ngokutsha zibe$color-contrast-dark
kunye$color-contrast-light
.
-
UkuqhawulaI-Media query mixins parameters itshintshile ngendlela enengqiqo.
media-breakpoint-down()
isebenzisa i-breakpoint ngokwayo endaweni ye-breakpoint elandelayo (umzekelo,media-breakpoint-down(lg)
endawenimedia-breakpoint-down(md)
yeetekeni zokujonga iizibuko ezincinci kuno-lg
).- Ngokufanayo, eyesibini iparameter ikwanayo
media-breakpoint-between()
isebenzisa ibreakpoint ngokwayo endaweni yebreakpoint elandelayo (umzekelo,media-between(sm, lg)
endawenimedia-breakpoint-between(sm, md)
yojongo lwezibuko phakathism
kunyelg
).
-
UkuqhawulaIzimbo zokuprinta ezisusiweyo kunye
$enable-print-styles
nokwahluka. Iiklasi zokubonisa ushicilelo zisakho. Bona #28339 . -
UkuqhawulaIlahliwe
color()
,theme-color()
, kunyegray()
nemisebenzi exhasa iinguqu. Bona #29083 . -
Ukuqhawula
theme-color-level()
Umsebenzi othiywe kwakhonacolor-level()
kwaye ngoku wamkela nawuphi na umbala owufunayo endaweni$theme-color
yemibala kuphela. Bona #29083 Qaphela:color-level()
kamva yaphoswa phakathiv5.0.0-alpha3
. -
UkuqhawulaIthiywe ngokutsha
$enable-prefers-reduced-motion-media-query
kunye$enable-pointer-cursor-for-buttons
nokuya$enable-reduced-motion
kunye$enable-button-pointers
nobufutshane. -
UkuqhawulaSusa
bg-gradient-variant()
umxube. Sebenzisa.bg-gradient
iklasi ukongeza i-gradient kwizinto endaweni.bg-gradient-*
yeeklasi ezenziweyo. -
Ukuqhawula Ikhutshiwe imixube ebikade iyekiwe:
hover
,hover-focus
,plain-hover-focus
, kwayehover-focus-active
float()
form-control-mixin()
nav-divider()
retina-img()
text-hide()
(iphinde yawisa udidi oluluncedo olunxulumeneyo,.text-hide
)visibility()
form-control-focus()
-
Ukuqhawula
scale-color()
Umsebenzi othiyweshift-color()
ngokutsha ukunqanda ukungqubana nomsebenzi we-Sass wokulinganisa umbala. -
box-shadow
imixube ngoku ivumelanull
amaxabiso kwaye yehlenone
kwiimpikiswano ezininzi. Bona #30394 . -
Umxube
border-radius()
ngoku unexabiso elingagqibekanga.
Inkqubo yombala
-
Isixokelelwano sombala ebesisebenza
color-level()
saza$theme-color-interval
sasuswa sixhasa inkqubo entsha yombala. Yonkelighten()
kunyedarken()
nemisebenzi kwi-codebase yethu ithathelwa indawotint-color()
kwayeshade-color()
. Le misebenzi iya kuxuba umbala nokuba mhlophe okanye mnyama endaweni yokutshintsha ukukhanya kwayo ngexabiso elimiselweyo. Ishift-color()
-tint okanye i-shades umbala ngokuxhomekeke ekubeni ubunzima bayo beparameter bulungile okanye bungalunganga. Bona #30622 ngeenkcukacha ezithe vetshe. -
Kongezwe imibala emitsha kunye nemibala yombala ngamnye, ukubonelela ngemibala esithoba eyahlukileyo kumbala wesiseko ngamnye, njengoguquko olutsha lweSass.
-
Uphuculo lomahluko wombala. Umlinganiselo wokuchasana kombala ogingqiweyo ukusuka ku-3:1 ukuya ku-4.5:1 kunye nohlaziyo lwemibala eluhlaza okwesibhakabhaka, eluhlaza, ecyan, kunye nepinki ukuqinisekisa umahluko weWCAG 2.1 AA. Kwakhona utshintshe umbala wethu womahluko ukusuka
$gray-900
ku$black
. -
Ukuxhasa inkqubo yethu yemibala, songeze isiko
tint-color()
kunyeshade-color()
nemisebenzi emitsha ukuxuba imibala yethu ngokufanelekileyo.
Uhlaziyo lwegridi
-
Inqaku elitsha! Kongezwe indawo entsha
xxl
yokuqhawula1400px
kunye nokunyuka. Akukho lutshintsho kuzo zonke ezinye iindawo zokuphumla. -
Iigatha eziphuculweyo. Iigatha ngoku zisetiwe kwi-rems, kwaye zincinci kune-v4 (
1.5rem
, okanye malunga24px
, ezantsi ukusuka30px
). Oku kulungelelanisa iigutha zenkqubo yethu yegridi kunye nezixhobo zethu zokubeka izithuba.- Kongezwe udidi olutsha lwegutter (
.g-*
,.gx-*
, kunye.gy-*
) ukulawula iigatha ezithe tye/ezithe nkqo, iigatha ezithe tyaba, kunye neegatha ezithe nkqo. - UkuqhawulaInikwe elinye igama
.no-gutters
ukuze.g-0
itshatise izinto ezintsha zokugalela amanzi.
- Kongezwe udidi olutsha lwegutter (
-
Imihlathi ayisasetyenziswa
position: relative
, ngoko kungafuneka udibanise.position-relative
kwezinye izinto ukubuyisela ukuziphatha. -
UkuqhawulaIiklasi ezininzi
.order-*
ziye zayeka ukusetyenziswa rhoqo. Ngoku sibonelela kuphela.order-1
ngaphandle.order-5
kwebhokisi. -
UkuqhawulaIlahliwe
.media
icandelo njengoko inokuphinda iphindwe ngokulula ngezinto eziluncedo. Jonga i-#28265 kunye nephepha lezinto eziguqukayo zomzekelo . -
Ukuqhawula
bootstrap-grid.css
ngoku isebenza kuphelabox-sizing: border-box
kumqolo endaweni yokusetha kwakhona ubungakanani bebhokisi yehlabathi. Ngale ndlela, izitayile zethu zegridi zinokusetyenziswa kwiindawo ezininzi ngaphandle kokuphazamiseka. -
$enable-grid-classes
ayisayi kuvala ukuveliswa kweeklasi zesikhongozeli kwakhona. Bona #29146. -
Ihlaziywe i-
make-col
mixin ukuya kwimiqolo elinganayo ngaphandle kobukhulu obuxeliweyo.
Umxholo, Qalisa kwakhona, njl
-
I- RFS ngoku yenziwe ngokungagqibekanga. Izihloko ezisebenzisa i-
font-size()
mixin ziya kuzilungelelanisa ngokuzenzekelayo ukukalafont-size
kunye ne-viewport. Eli nqaku belikade likhetha ukungena nge-v4. -
UkuqhawulaUhlengahlengiso lwethu lokuchwetheza lokuchwetheza ukuze endaweni yenguqu zethu
$display-*
kunye$display-font-sizes
nemephu ye-Sass. Kwakhona kususwe ii-$display-*-weight
variables zomntu omnye$display-font-weight
kunye nohlengahlengisofont-size
s. -
Kongezwe iisayizi ezimbini zezihloko ezintsha
.display-*
,.display-5
kunye.display-6
. -
Unxulumano lukrwelelwa umgca ngaphantsi ngokungagqibekanga (hayi nje kwi hover), ngaphandle kokuba yinxalenye yamacandelo athile.
-
Ziyilwe ngokutsha iitafile ukuhlaziya izitayile zazo kunye nokuzakha kwakhona ngezinto eziguquguqukayo zeCSS zolawulo ngakumbi kwisitayile.
-
UkuqhawulaIitheyibhile ezibekwe kwindlwane aziphindi zifumane izimbo.
-
Ukuqhawula
.thead-light
kwaye.thead-dark
ziwisiwe kukhetho.table-*
olwahlukileyo lweeklasi ezinokuthi zisetyenziswe kuzo zonke iziqalelo zetafile (thead
,tbody
,tfoot
,tr
,th
kunyetd
). -
UkuqhawulaUmxube
table-row-variant()
uqanjwe ngokutshatable-variant()
kwaye wamkela kuphela iiparamitha ezi-2:$color
(igama lombala) kunye$value
(ikhowudi yombala). Umbala womda kunye nemibala ye-accent ibalwa ngokuzenzekelayo ngokusekelwe kwi-table factor variables. -
Ukwahlula iiguquguquko zeselfowuni ezikhuselweyo zibe
-y
kunye-x
. -
UkuqhawulaIphumile
.pre-scrollable
iklasi. Bona #29135 -
Ukuqhawula
.text-*
izinto eziluncedo azisongezi i-hover kunye neendawo zokugxila kumakhonkco kwakhona..link-*
iiklasi zabancedisi zingasetyenziswa endaweni yoko. Bona #29267 -
UkuqhawulaIphumile
.text-justify
iklasi. Bona #29793 -
Ukuqhawula
<hr>
izinto ezisetyenziswayo ngokuheight
endaweniborder
yokuxhasa ngconosize
uphawu. Oku kukwavumela ukusetyenziswa kwezinto eziluncedo zokudibanisa ukwenza izahluli ezityebileyo (umz.,<hr class="py-1">
). -
Cwangcisa ngokutsha okumiselweyo okuthe tye kunye
padding-left
nezinto ukusuka kwibhrawuza ukuya kwi .<ul>
<ol>
40px
2rem
-
Yongeziweyo
$enable-smooth-scroll
, esebenzascroll-behavior: smooth
kwihlabathi-ngaphandle kwabasebenzisi abacela ukuncitshiswa kwentshukumo ngombuzoprefers-reduced-motion
wemidiya. Bona #31877
RTL
- Umkhombandlela othe tyaba izinto eziguquguqukayo ezithile, izinto eziluncedo, kunye nemixube zonke ziye zanikwa elinye igama ukuze zisebenzise iipropati ezinengqiqo ezifana nezo zifumaneka kuyilo lwe-flexbox-umz,
start
kwayeend
endawenileft
yeright
.
Iifom
-
Kongezwe iifomu ezintsha ezidadayo! Siwunyusile umzekelo weelebhile ezidadayo kumacandelo efom exhaswa ngokupheleleyo. Jonga iphepha elitsha leelebhile ezidadayo.
-
Ukuqhawula Izinto ezidityanisiweyo zemveli kunye nefom yesiqhelo. Iibhokisi zokutshekisha, oonomathotholo, ukhetho, kunye namanye amagalelo aneeklasi zomthonyama kunye nezesiko kwi-v4 ziye zadityaniswa. Ngoku phantse zonke izinto zethu zefom zisisiqhelo ngokupheleleyo, uninzi ngaphandle kwesidingo seHTML yesiko.
.custom-control.custom-checkbox
ngoku.form-check
..custom-control.custom-custom-radio
ngoku.form-check
..custom-control.custom-switch
ngoku.form-check.form-switch
..custom-select
ngoku.form-select
..custom-file
kwaye.form-file
zithathelwe indawo zizimbo zesiko ngaphezulu kwe.form-control
..custom-range
ngoku.form-range
.- Iwisiwe yemveli
.form-control-file
kwaye.form-control-range
.
-
UkuqhawulaYehla
.input-group-append
kwaye.input-group-prepend
. Ngoku unokongeza amaqhosha kwaye.input-group-text
njengabantwana ngokuthe ngqo bamaqela egalelo. -
Irediyasi yomda esele Ilahlekile kwiqela longeniso kunye nebug yengxelo yokuqinisekisa ekugqibeleni ilungisiwe ngokongeza
.has-validation
udidi olongezelelweyo kumaqela ongeniso ngokuqinisekisa. -
Ukuqhawula Iiklasi eziyehliweyo zoyilo lwenkqubo yethu yegridi. Sebenzisa igridi yethu kunye nezinto eziluncedo endaweni ye
.form-group
,.form-row
, okanye.form-inline
. -
UkuqhawulaIilebhile zefom ngoku zifuna
.form-label
. -
Ukuqhawula
.form-text
akusasetidisplay
, ikuvumela ukuba wenze ngaphakathi okanye uvimbele okubhaliweyo koncedo njengoko unqwenela ngokutshintsha into yeHTML. -
Ulawulo
height
lwefomu alusasetyenziswa lulungisiwe xa kunokwenzeka, endaweni yoko luhlehlisamin-height
ekuphuculeni ukwenziwa nokuhambelana namanye amacandelo. -
Ii icon zokuqinisekisa azisasetyenziswa kwi
<select>
s ngemultiple
. -
Umthombo ohlengahlengisiweyo weefayile zeSass phantsi
scss/forms/
, kubandakanywa izimbo zeqela longeniso.
Amacandelo
- Amaxabiso adityanisiweyo kwizilumkiso, i-breadcrumbs, amakhadi, okokwehla
padding
, amaqela oluhlu, iimodyuli, iipopovers, kunye neengcebiso zezixhobo ezisekelwe kuguquko lwethu$spacer
. Bona #30564 .
IAccordion
- Kongezwe icandelo elitsha leakhodiyoni .
Izilumkiso
-
Izivuseleli ngoku zinemizekelo ene-icon .
-
Susa izimbo zesiko kwi
<hr>
s kwisivuseleli ngasinye kuba sele zisebenzisacurrentColor
.
Iibheji
-
UkuqhawulaZiye zalahla zonke
.badge-*
iiklasi zemibala kwizinto eziluncedo ezingasemva (umzekelo, sebenzisa.bg-primary
endaweni ye.badge-primary
). -
UkuqhawulaIlahliwe
.badge-pill
-sebenzisa into.rounded-pill
eluncedo endaweni yoko. -
UkuqhawulaIsusiwe ihover kunye nezimbo zokugxila
<a>
kunye<button>
nezinto. -
Ukunyuswa kwezikhuseli ezihlala zikhona kwiibheji ukusuka
.25em
/.5em
ukuya.35em
/.65em
.
Iimvuthuluka zezonka
-
Yenziwe lula inkangeleko engagqibekanga yesonka sesonka ngokususa
padding
,background-color
kunyeborder-radius
. -
Kongezwe ipropathi entsha yesiko le-CSS
--bs-breadcrumb-divider
ukwenza kube lula ngaphandle kokufuna ukuphinda kuqokelelwe iCSS.
Amaqhosha
-
Ukuqhawula Amaqhosha okuguqula , kunye neebhokisi zokukhangela okanye iirediyo, azisafuni JavaScript kwaye unophawu olutsha. Asisafuni nto yokusonga, yongeza
.btn-check
kwi<input>
, kwaye uyibhanqe nazo naziphi na.btn
iiklasi ezikwi<label>
. Bona #30650 . Amaxwebhu oku asukile kwiphepha lethu lamaQhosha ukuya kwicandelo elitsha leeFom. -
Ukuqhawula Ilahliwe
.btn-block
kwizinto eziluncedo. Endaweni yokusebenzisa.btn-block
kwi-.btn
, songela amaqhosha akho kunye.d-grid
nesixhobo.gap-*
sokuwabeka njengoko kufuneka. Tshintshela kwiiklasi eziphendulayo ukuze ukwazi ukulawula ngakumbi kuzo. Funda amaxwebhu ngemizekelo ethile. -
Uhlaziyo lwethu
button-variant()
kunyebutton-outline-variant()
nemixube ukuxhasa iiparamitha ezongezelelweyo. -
Amaqhosha ahlaziyiweyo ukuqinisekisa ukwanda kokuchasana kwi-hover kunye neemeko ezisebenzayo.
-
Amaqhosha avaliweyo ngoku ane
pointer-events: none;
.
Ikhadi
-
UkuqhawulaYamkela
.card-deck
igridi yethu. Gquba amakhadi akho kwiiklasi zekholomu kwaye wongeze.row-cols-*
isikhongozelo somzali ukuze uphinde wenze iidekhi zekhadi (kodwa ngolawulo olungakumbi malunga nokulungelelaniswa okuphendulayo). -
UkuqhawulaYehla
.card-columns
ngokuthanda iMasonry. Bona #28922 . -
UkuqhawulaKutshintshwe iaccordion
.card
esekwe ngecandelo elitsha leAccordion .
I-Carousel
-
Kongezwe ukwahluka okutsha
.carousel-dark
kumbhalo omnyama, ulawulo, kunye nezalathi (ezinkulu kwimvelaphi ekhanyayo). -
Kutshintshwe ii-icon ze-chevron zolawulo lwe-carousel ngee-SVG ezintsha ezivela kwii- Icons zeBootstrap .
Vala iqhosha
-
UkuqhawulaIthiywe ngokutsha
.close
ukuya kwigama.btn-close
elincinci elenziwe lafana. -
Vala amaqhosha ngoku sebenzisa
background-image
(i-SVG elungisiweyo) endaweni ye-a×
kwi-HTML, ivumela ukwenziwa kube lula ngaphandle kwesidingo sokuchukumisa uphawu lwakho. -
Kongezwe
.btn-close-white
uhlobo olutsha olusebenzisafilter: invert(1)
ukwenza umahluko ophezulu wokugxotha ii-icon ngokuchasene nemvelaphi emnyama.
Ukuwa
- Isusiwe i-ankile yokuskrola yee-accordions.
Ukwehla
-
Kongezwe
.dropdown-menu-dark
uhlobo olutsha kunye noguquguquko oluhambelanayo lokwehliswa okumnyama okufunekayo. -
Kongezwe utshintsho olutsha lwe
$dropdown-padding-x
. -
Yenze mnyama isahluli sohlayo ukwenzela umahluko ophuculweyo.
-
UkuqhawulaYonke iminyhadala yokwehla ngoku ishukunyiswa kwiqhosha lokuguqula elilahlayo kwaye emva koko iqatywe ukuya kwinto yomzali.
-
Iimenu eziwisa phantsi ngoku zineseti yophawu
data-bs-popper="static"
xa indawo yokuhla imile, okanye eyehlayo ikwinavbar. Oku kongezwa yiJavaScript yethu kwaye isinceda ukuba sisebenzise izimbo zesiko ngaphandle kokuphazamisa indawo yePopper. -
UkuqhawulaIlahliwe
flip
ukhetho lweplagin eyehlayo ithanda uqwalaselo lwendalo lwePopper. Ngoku ungakhubaza indlela yokuziphatha ngokudlula uluhlu olungenanto lwenkethofallbackPlacements
kwisilungisi se- flip . -
Iimenu ezilahliweyo ngoku zinokucofa ngokhetho olutsha
autoClose
lokuphatha impatho yokuvala ngokuzenzekelayo . Ungasebenzisa olu khetho ukwamkela ukucofa ngaphakathi okanye ngaphandle kwemenu eyehlayo ukuyenza isebenze. -
Iidropdowns ngoku zixhasa
.dropdown-item
s esongelwe kwi-<li>
s.
Jumbotron
- UkuqhawulaIlahliwe icandelo lejumbotron njengoko inokuphinda iphindwe ngezinto eziluncedo. Jonga umzekelo wethu omtsha weJumbotron wedemo.
Uluhlu lweqela
.list-group-numbered
Kongezwe isilungisi esitsha kuluhlu lwamaqela.
I-Navs kunye neethebhu
- Kongezwe izinto ezintsha
null
eziguquguqukayo zefont-size
,font-weight
,color
, kunye:hover
color
neklasi.nav-link
.
Navbars
- UkuqhawulaIiNavbar ngoku zifuna isikhongozeli ngaphakathi (ukwenza lula kakhulu iimfuno zesithuba kunye neCSS efunekayo).
- UkuqhawulaIklasi
.active
ayinakuphinda isetyenziswe kwi-.nav-item
s, kufuneka isetyenziswe ngokuthe ngqo kwi-.nav-link
s.
I-offcanvas
- Yongezwe icandelo elitsha le- offcanvas .
Ukwenziwa kwePagination
-
Amakhonkco ePagination ngoku ayakwazi ukwenzeka
margin-left
ajikelezwe ngokuguquguqukayo kuzo zonke iikona xa zahluliwe enye kwenye. -
Yongezwa
transition
s kumakhonkco epagination.
Iipopovers
-
UkuqhawulaIqanjwe
.arrow
ngokutsha.popover-arrow
kwitemplate yethu yepopover engagqibekanga. -
whiteList
Inketho ethiywe ngokutsha kuallowList
.
Iispinners
-
Iispinner ngoku
prefers-reduced-motion: reduce
ziwonga ngokucothisa oopopayi. Bona #31882 . -
Ulungelelwaniso oluthe nkqo lwesipinari.
Iithowusti
-
Iithowusti ngoku zinokubekwa kwi-
.toast-container
a ngoncedo lokubeka izinto eziluncedo . -
Kutshintshwe ubude bexesha le-toast elimiselweyo ukuya kwimizuzwana emi-5.
-
Isusiwe
overflow: hidden
kwi toasts kwaye endaweniborder-radius
s efanelekileyo kunyecalc()
nemisebenzi.
Iingcebiso
-
UkuqhawulaInikwe igama elitsha
.arrow
kwithempleyithi.tooltip-arrow
yethu yesixhobo esingagqibekanga. -
UkuqhawulaIxabiso elimiselweyo le-
fallbackPlacements
itshintshelwe['top', 'right', 'bottom', 'left']
ekubekweni ngcono kwezinto ze-popper. -
Ukuqhawula
whiteList
Inketho ethiywe ngokutsha kuallowList
.
Izinto eziluncedo
-
UkuqhawulaIthiywe ngokutsha izinto ezininzi ukuze kusetyenziswe amagama epropathi ebhadlileyo endaweni yamagama ezalathiso kunye nokongezwa kwenkxaso ye-RTL:
- Ithiywe ngokutsha
.left-*
kwaye.right-*
ukuya.start-*
kunye.end-*
. - Ithiywe ngokutsha
.float-left
kwaye.float-right
ukuya.float-start
kunye.float-end
. - Ithiywe ngokutsha
.border-left
kwaye.border-right
ukuya.border-start
kunye.border-end
. - Ithiywe ngokutsha
.rounded-left
kwaye.rounded-right
ukuya.rounded-start
kunye.rounded-end
. - Ithiywe ngokutsha
.ml-*
kwaye.mr-*
ukuya.ms-*
kunye.me-*
. - Ithiywe ngokutsha
.pl-*
kwaye.pr-*
ukuya.ps-*
kunye.pe-*
. - Ithiywe ngokutsha
.text-left
kwaye.text-right
ukuya.text-start
kunye.text-end
.
- Ithiywe ngokutsha
-
UkuqhawulaIkhubaziwe imida echaseneyo ngokungagqibekanga.
-
Yongezwe
.bg-body
udidi olutsha lokucwangcisa ngokukhawuleza<body>
imvelaphi kwizinto ezongezelelweyo. -
Kongezwe indawo entsha yezinto eziluncedo ze
top
,right
,bottom
, kunyeleft
. Amaxabiso abandakanya0
,50%
, kunye100%
nepropati nganye. -
Kongezwe izinto ezintsha
.translate-middle-x
kunye.translate-middle-y
nezinto eziluncedo kwindawo ethe tyaba okanye ethe nkqo kumbindi ogqibeleleyo/ezizinzileyo izinto ezimiyo. -
Kongezwe
border-width
izixhobo ezitsha . -
UkuqhawulaInikwe igama ngokutsha
.text-monospace
ibe.font-monospace
. -
UkuqhawulaIsusiwe
.text-hide
njengoko iyindlela yakudala yokufihla okubhaliweyo okungamelanga kuphinde kusetyenziswe. -
.fs-*
Izinto eziluncedo ezongeziweyofont-size
(ezine-RFS enikwe amandla). Ezi zisebenzisa isikali esifanayo njengezihloko ezingagqibekanga ze-HTML (1-6, enkulu ukuya kwencinci), kwaye inokuguqulwa ngemephu ye-Sass. -
UkuqhawulaIinkonzo ezithiywe
.font-weight-*
ngokutsha njengobufutshane.fw-*
kunye nokungaguquguquki. -
UkuqhawulaIinkonzo ezithiywe
.font-style-*
ngokutsha njengobufutshane.fst-*
kunye nokungaguquguquki. -
Yongezwe
.d-grid
ukubonisa izinto eziluncedo kunye nezinto ezintshagap
(.gap
) zeCSS Igridi kunye noyilo lwebhokisi yeflex. -
UkuqhawulaIsusiwe
.rounded-sm
kwayerounded-lg
, kwaye yazisa isikali esitsha seeklasi,.rounded-0
ukuya.rounded-3
. Bona #31687 . -
Kongezwe
line-height
izinto eziluncedo ezintsha:.lh-1
,.lh-sm
,.lh-base
kunye.lh-lg
. Bona apha . -
Uhambise
.d-none
usetyenziso kwiCSS yethu ukuyinika ubunzima obungaphezulu kwezinye izinto eziluncedo zokubonisa. -
Wandisiwe
.visually-hidden-focusable
umncedi ukuba asebenze kwizikhongozeli, esebenzisa:focus-within
.
Abancedi
-
Ukuqhawula Abancedisi be-embed abaphendulayo baye babizwa ngokuba ngabancedisi bomlinganiselo abanamagama amatsha eklasi kunye nokuziphatha okuphuculweyo, kunye ne-CSS eluncedo.
- Iiklasi zithiywe ngokutsha ukuze zitshintshele
by
kwix
-aspect ratio. Ngokomzekelo,.ratio-16by9
ngoku.ratio-16x9
. - Silahle
.embed-responsive-item
umkhethi weqela kunye neqela ukuze sikhethe.ratio > *
umkhethi olula. Akukho klasi ifunekayo, kwaye umncedisi womlinganiselo ngoku usebenza nayo nayiphi na into ye-HTML. - Imephu ye-
$embed-responsive-aspect-ratios
Sass ithiywe ngokutsha$aspect-ratios
kwaye amaxabiso ayo enziwe lula ukubandakanya igama leklasi kunye nepesenti njengesibinikey: value
. - Izinto eziguquguqukayo zeCSS ngoku zenziwe kwaye zibandakanyiwe kwixabiso ngalinye kwimephu ye-Sass. Lungisa
--bs-aspect-ratio
uguqulo kwi-.ratio
uyila nawuphi na umlinganiselo wesiko lombono .
- Iiklasi zithiywe ngokutsha ukuze zitshintshele
-
Ukuqhawula Iiklasi “zokufunda isikrini” ngoku “zifihliwe ngokubonakalayo” iiklasi .
- Itshintshe ifayile yeSass ukusuka
scss/helpers/_screenreaders.scss
kwiscss/helpers/_visually-hidden.scss
- Ithiywe ngokutsha
.sr-only
kwaye.sr-only-focusable
ukuya.visually-hidden
kunye.visually-hidden-focusable
- Ithiywe ngokutsha
sr-only()
kunyesr-only-focusable()
nemixube ukuyavisually-hidden()
kunyevisually-hidden-focusable()
.
- Itshintshe ifayile yeSass ukusuka
-
bootstrap-utilities.css
ngoku baquka nabancedi bethu. Abancedi akusekho mfuneko yokuba bangeniswe kumazwe angaphandle kwizakhiwo zesiko.
JavaScript
-
Ilahliwe ukuxhomekeka kwejQuery kwaye iphinde ibhale iiplagi ukuba zibe kwiJavaScript eqhelekileyo.
-
UkuqhawulaIimpawu zedatha yazo zonke iiplagi zeJavaScript ngoku zinezithuba zamagama ukunceda ukwahlula ukusebenza kweBootstrap kwiqela lesithathu kunye nekhowudi yakho. Ngokomzekelo, sisebenzisa
data-bs-toggle
endaweni ye-data-toggle
. -
Zonke iiplagi ezifakiweyo ngoku zingamkela umkhethi weCSS njengengxoxo yokuqala. Ungadlula into yeDOM okanye nawuphi na umkhethi osebenzayo weCSS ukwenza umzekelo omtsha weplagi:
const modal = new bootstrap.Modal('#myModal') const dropdown = new bootstrap.Dropdown('[data-bs-toggle="dropdown"]')
-
popperConfig
ingagqithiswa njengomsebenzi owamkela uqwalaselo olungagqibekanga lweBootstrap lwePopper njengempikiswano, ukuze ukwazi ukudibanisa olu qwalaselo olungagqibekanga kwindlela yakho. Isebenza kwiidropdowns, popovers, kunye netooltips. -
Ixabiso elimiselweyo le-
fallbackPlacements
itshintshelwe['top', 'right', 'bottom', 'left']
ekubekweni okungcono kwezinto zePopper. Isebenza kwiidropdowns, popovers, kunye netooltips. -
Kususwe i-score kwiindlela ezizinzileyo zikawonke-wonke ezifana
_getInstance()
→getInstance()
.