Ithuthela ku-v4
I-Bootstrap 4 iwukubhala kabusha okukhulu kwayo yonke iphrojekthi. Izinguquko eziphawuleka kakhulu zifingqiwe ngezansi, zilandelwa izinguquko eziqondile ezingxenyeni ezifanele.
Ukusuka ku-Beta 3 kuya ekukhishweni kwethu okuzinzile kwe-v4.0, azikho izinguquko eziphukayo, kodwa kukhona izinguquko eziphawulekayo.
-
Izinsiza zokuphrinta eziphukile ezilungisiwe. Ngaphambilini, ukusebenzisa
.d-print-*
ikilasi kwakuzoqeda ngokungalindelekile esinye.d-*
isigaba. Manje, afanisa nezinye izinsiza zethu zokubonisa futhi asebenza kuleyo midiya kuphela (@media print
). -
Kunwetshwe izinsiza zokubonisa zokuphrinta ezitholakalayo ukuze zifane nezinye izinsiza. I-Beta 3 nangaphezulu babenayo kuphela
block
,inline-block
,inline
, kanyenone
. I- v4 ezinzile yengeziweflex
,inline-flex
,table
,table-row
, kanyetable-cell
. -
Ukunikezwa kokuhlola kuqala kokuphrinta kuzo zonke iziphequluli ezinezitayela zokuphrinta ezintsha ezicacisa
@page
size
.
Ngenkathi i-Beta 2 ibone inqwaba yezinguquko zethu eziphukayo ngesikhathi sesigaba se-beta, kodwa sisenokumbalwa obekudingeka kukhulunywe ngakho ekukhishweni kwe-Beta 3. Lezi zinguquko zisebenza uma uthuthukela ku-Beta 3 usuka ku-Beta 2 nanoma iyiphi inguqulo endala ye-Bootstrap.
- Kukhishwe
$thumbnail-transition
okuguquguqukayo okungasetshenzisiwe. Besingashintshi lutho, ngakho bekuyikhodi eyengeziwe. - Iphakheji ye-npm ayisafaki noma yimaphi amafayela ngaphandle kwamafayela ethu omthombo kanye ne-dist; uma ubuthembele kuzo futhi ubusebenzisa izikripthi zethu
node_modules
ngefolda, kufanele uvumelanise ukuhamba kwakho komsebenzi.
-
Bhala kabusha kokubili amabhokisi okuhlola angokwezifiso nazenzakalelayo kanye nemisakazo. Manje, bobabili banesakhiwo se-HTML esifanayo (engaphandle
<div>
nengane yakini<input>
kanye<label>
) nezitayela ezifanayo zesakhiwo (okuzenzakalelayo okustakiwe, okuhambisana nekilasi lesilungisi). Lokhu kusivumela ukuthi senze ilebula ngesitayela ngokusekelwe esimweni sokufakwayo, ukwenza lula ukusekelwadisabled
kwesibaluli (ngaphambilini obekudinga isigaba sabazali) futhi sikusekele kangcono ukuqinisekiswa kwefomu lethu.Njengengxenye yalokhu, sishintshe i-CSS yokuphatha ama-multiples
background-image
kumabhokisi okuhlola amafomu angokwezifiso namarediyo. Ngaphambilini, into manje ekhishiwe.custom-control-indicator
yayinombala wangemuva, i-gradient, nesithonjana se-SVG. Ukwenza ngendlela oyifisayo i-gradient yangemuva kwakusho ukumiselela zonke lezo ngaso sonke isikhathi lapho udinga ukushintsha okukodwa. Manje,.custom-control-label::before
sinokugcwalisa kanye negradient futhi.custom-control-label::after
siphatha isithonjana.Ukuze wenze ukuhlola kwangokwezifiso emgqeni, engeza
.custom-control-inline
. -
Isikhethi esibuyekeziwe samaqembu ezinkinobho ezisuselwe kokokufaka. Esikhundleni
[data-toggle="buttons"] { }
sesitayela nokuziphatha, sisebenzisadata
isibaluli ekuziphatheni kwe-JS kuphela futhi sithembele.btn-group-toggle
ekilasini elisha ukwenza isitayela. -
Kukhishwe
.col-form-legend
kuvumela okuthuthukisiwe kancane.col-form-label
. Le ndlela.col-form-label-sm
futhi.col-form-label-lg
ingasetshenziswa ezintweni<legend>
kalula. -
Okokufaka kwamafayela ngokwezifiso kuthole ushintsho
$custom-file-text
kokuhluka kwawo kwe-Sass. Ayiseyona imephu ye-Sass efakwe esidlekeni futhi manje inika amandla iyunithi yezinhlamvu eyodwa kuphela—Browse
inkinobho njengoba manje sekuwukuphela kwento-mbumbulu ekhiqizwe ku-Sass yethu. UmbhaloChoose file
manje uvela ku-.custom-file-label
.
-
Ama-addon eqembu lokokufaka manje aqondene nokubekwa kwawo ngokuhlobene nokokufaka. Sehlile
.input-group-addon
futhi.input-group-btn
emakilasini amabili amasha,.input-group-prepend
futhi.input-group-append
. Kufanele usebenzise isithasiselo ngokusobala noma ulungiselele manje, wenze ingxenye enkulu ye-CSS yethu ibe lula. Ngaphakathi kwe-append noma lungiselela, beka izinkinobho zakho njengoba zingaba khona kwenye indawo, kodwa goqa umbhalo ngo-.input-group-text
. -
Izitayela zokuqinisekisa manje ziyasekelwa, njengoba kunjalo nokokufaka okuningi (yize ungaqinisekisa okokufaka okukodwa kuphela eqenjini ngalinye).
-
Amakilasi okulinganisa kufanele abe kumzali
.input-group
hhayi kuma-elementi efomu ngalinye.
Ngenkathi siku-beta, sihlose ukungabi nezinguquko eziphukayo. Nokho, izinto azihambi njengoba bekuhleliwe. Ngezansi izinguquko ezihamba phambili okufanele uzikhumbule lapho usuka ku-Beta 1 uye ku-Beta 2.
- Okuguquguqukayo okususiwe
$badge-color
kanye nokusetshenziswa kwayo ku-.badge
. Sisebenzisa umsebenzi wokugqama kombala ukuze sikhethecolor
okusekelwe kokuthibackground-color
, ngakho okuhlukile akudingekile. grayscale()
Umsebenzi oqanjwe kabushagray()
ukuze ugweme ukungqubuzanagrayscale
nesihlungi somdabu se-CSS.- Kuqanjwe kabusha
.table-inverse
,.thead-inverse
, futhi.thead-default
kuya.*-dark
futhi.*-light
, ukufanisa izikimu zethu zombala ezisetshenziswa kwenye indawo. - Amathebula aphendulayo manje akhiqiza amakilasi ephoyinti ngalinye legridi. Lokhu kwehlukana ku-Beta 1 ngoba
.table-responsive
obukade uyisebenzisa kufana kakhulu.table-responsive-md
. Manje ungasebenzisa.table-responsive
noma.table-responsive-{sm,md,lg,xl}
njengoba kudingeka. - Usekelo lwe-Bower eyehlisiwe njengoba umphathi wephakheji wehlisiwe kwezinye izinto (isb, Intambo noma i-npm). Bona i-bower/bower#2298 ukuze uthole imininingwane.
- I-Bootstrap isadinga i-jQuery 1.9.1 noma ngaphezulu, kodwa uyelulekwa ukuthi usebenzise inguqulo 3.x njengoba iziphequluli ezisekelwa yi-v3.x kuyizona ezisekelwa yi-Bootstrap futhi i-v3.x inokulungiswa okuthile kwezokuphepha.
.form-control-label
Kukhishwe ikilasi elingasetshenzisiwe . Uma uye wasebenzisa lesi sigaba, bekuyimpinda.col-form-label
yekilasi elimise maphakathi nendawo ngokuthi a<label>
nokokufaka okuhlotshaniswa naso kuzakhiwo zefomu elivundlile.- Kushintshwe i
color-yiq
-mixin esuka kumxube ohlanganisacolor
isakhiwo ukuze isebenze ebuyisela inani, okukuvumela ukuthi uyisebenzisele noma iyiphi impahla ye-CSS. Isibonelo, esikhundleni sokuthicolor-yiq(#000)
, ungabhalacolor: color-yiq(#000);
.
- Kwethulwe
pointer-events
ukusetshenziswa okusha kumamodeli. Ingaphandle.modal-dialog
idlula emicimbinipointer-events: none
enokuphathwa kokuchofoza ngokwezifiso (okwenza ukwazi ukuvele ulalele.modal-backdrop
kunoma yikuphi ukuchofoza), bese iphikisana nalokho okwangempela.modal-content
nge-pointer-events: auto
.
Nazi izinto zamathikithi amakhulu ozofuna ukuzazi lapho usuka ku-v3 uye ku-v4.
- Kwehlisiwe usekelo lwe-IE8, IE9, ne-iOS 6. I-v4 manje isiyi-IE10+ kuphela ne-iOS 7+. Kumasayithi adinga enye yalezo, sebenzisa i-v3.
- Kwengezwe usekelo olusemthethweni lwe-Android v5.0 Lollipop's Browser kanye neWebView. Izinguqulo zangaphambili zeSiphequluli se-Android ne-WebView zihlala zisekelwa ngokungekho emthethweni kuphela.
- I-Flexbox inikwe amandla ngokuzenzakalelayo. Ngokuvamile lokhu kusho ukusuka ekuntanteni nokunye okwengeziwe kuzo zonke izingxenye zethu.
- Ushintshe ukusuka kokuthi Okuncane ukuya kwa - Sass ukuze uthole amafayela wethu we-CSS ongumthombo.
- Ishintshelwe ekubeni
px
iyunithirem
yethu eyinhloko ye-CSS, nakuba amaphikseli asasetshenziselwa imibuzo yemidiya nokuziphatha kwegridi njengoba izimbobo zokubuka zedivayisi zingathintwa usayizi wohlobo. - Usayizi wefonti womhlaba wonke ukhuphuke ukusuka
14px
ku-16px
. - Kubuyekezwe ama-grid tiers ukuze kwengezwe inketho yesihlanu (ikhuluma namadivayisi amancane
576px
ngaphansi nangaphansi) futhi yasusa i--xs
infix kulawo makilasi. Isibonelo:.col-6.col-sm-4.col-md-3
. - Kushintshwe itimu yokuzikhethela ehlukene ngezinketho ezilungisekayo ngokusebenzisa okuguquguqukayo kwe-SCSS (isb,
$enable-gradients: true
). - Yakha isistimu eshintshiwe ukuze usebenzise uchungechunge lwemibhalo ye-npm esikhundleni se-Grunt. Bona
package.json
yonke imibhalo, noma iphrojekthi yethu ifundelwe izidingo zokuthuthukiswa kwendawo. - Ukusetshenziswa okungaphenduli kwe-Bootstrap akusasekelwa.
- Kwehliswe i-Customizer eku-inthanethi ukuze ivune amadokhumenti okusetha abanzi kanye nezakhiwo ezenziwe ngokwezifiso.
- Kwengezwe inqwaba yamakilasi ensiza entsha yamapheya enani lempahla ye-CSS kanye nezinqamuleli zesikhala semajini/sokupheda.
- Ihanjiswe ku-flexbox.
- Kwengezwe usekelo lwe-flexbox kumamiksi egridi namakilasi achazwe ngaphambilini.
- Njengengxenye ye-flexbox, kufakwe usekelo lwamakilasi okuqondanisa aqondile navundlile.
- Kubuyekezwe amagama ekilasi legridi kanye nesigaba segridi esisha.
- Kwengezwe i-
sm
grid tier entsha ngezansi768px
ukuze uthole ukulawula kwe-granular okwengeziwe. Manje sinakhoxs
,sm
,md
,lg
, kanyexl
. Lokhu kusho futhi ukuthi wonke ama-tier akhushulelwe izinga elilodwa (ngakho.col-md-6
ku-v3 manje.col-lg-6
isiku-v4). xs
amakilasi egridi ashintshiwe ukuze angadingi i-infix ukuze imele ngokunembe kakhudlwana ukuthi aqala ukusebenzisa izitayelamin-width: 0
hhayi inani le-pixel elimisiwe. Esikhundleni sokuthi.col-xs-6
, manje.col-6
. Wonke amanye ama-grid tiers adinga i-infix (isb,sm
).
- Kwengezwe i-
- Kubuyekezwe osayizi begridi, imiksi, neziguquguqukayo.
- Ama-gutter egridi manje anemephu ye-Sass ukuze ukwazi ukucacisa ububanzi obuthile be-gutter endaweni ngayinye yokuhlukana.
- Kubuyekezwe imiksi yegridi ukuze kusetshenziswe
make-col-ready
imiksi yokulungiselela kanye nokusethamake-col
usayizi wekholomu ngayinye.flex
max-width
- Kushintshwe amaphoyinti okunqamula umbuzo wesistimu yegridi yemidiya nobubanzi besiqukathi ukuze kubhekelelwe isigaba segridi esisha futhi kuqinisekiswe ukuthi amakholomu ahlukaniswa ngokulinganayo
12
ngobubanzi bawo obukhulu. - Izinqamuleli zegridi nobubanzi besiqukathi manje sesingathwa ngamamephu we-Sass (
$grid-breakpoints
kanye$container-max-widths
) esikhundleni sokumbalwa okuhlukile okuhlukile. Lezi zishintsha@screen-*
okuguquguqukayo ngokuphelele futhi zikuvumela ukuthi wenze ngokwezifiso ama-grid tiers. - Imibuzo yemidiya nayo ishintshile. Esikhundleni sokuphinda izimemezelo zemibuzo yethu yemidiya enenani elifanayo isikhathi ngasinye, manje sesine-
@include media-breakpoint-up/down/only
. Manje, esikhundleni sokubhala@media (min-width: @screen-sm-min) { ... }
, ungabhala@include media-breakpoint-up(sm) { ... }
.
- Amaphaneli awisiwe, izithonjana, nemithombo yengxenye entsha ehlanganisa konke, amakhadi .
- Kwehliswe ifonti yesithonjana se-Glyphicons. Uma udinga izithonjana, ezinye izinketho yilezi:
- inguqulo ekhuphukayo ye- Glyphicons
- Izenzo
- Ifonti Awesome
- Bheka ikhasi elithi Nweba ukuze uthole uhlu lwezinye izindlela. Uneziphakamiso ezengeziwe? Sicela uvule udaba noma i-PR.
- Kwehliswe i-plugin ye-Affix jQuery.
- Sincoma ukuthi usebenzise
position: sticky
esikhundleni salokho. Bheka i-HTML5 Sicela ufake ukuze uthole imininingwane kanye nezincomo ezithile zokugcwalisa okuningi. Esinye isiphakamiso siwukusebenzisa@supports
umthetho wokuwusebenzisa (isb.,@supports (position: sticky) { ... }
)/ - Uma ubusebenzisa i-Affix ukuze usebenzise izitayela ezengeziwe, okungezona
position
izitayela, ama-polyfill angase angasekeli icala lakho lokusebenzisa. Enye inketho yokusetshenziswa okunjalo umtapo wolwazi we -ScrollPos-Styler wenkampani yangaphandle .
- Sincoma ukuthi usebenzise
- Kwehliswe ingxenye ye-pager njengoba empeleni bekuyizinkinobho ezenziwe ngokwezifiso kancane.
- Kwenza kabusha cishe zonke izingxenye ukuze kusetshenziswe izikhethi zamakilasi ezingafakwanga esikhundleni sokukhetha izingane ezicaciswe kakhulu.
Lolu hlu lugqamisa izinguquko ezibalulekile ngengxenye phakathi kwe-v3.xx ne-v4.0.0.
Okusha ku-Bootstrap 4 Ukuqalisa Kabusha , ishidi lesitayela elisha elakhelwa kokuthi Normalise ngezitayela zethu zokusetha kabusha ezinemibono ethile. Izikhethi ezivela kuleli fayela zisebenzisa izici kuphela—awekho amakilasi lapha. Lokhu kuhlukanisa izitayela zethu zokusetha kabusha kuzitayela zengxenye yethu ukuze kusetshenziswe indlela ye-modular. Okunye ukusetha kabusha okubaluleke kakhulu lokhu okufaka phakathi box-sizing: border-box
ushintsho, ukusuka kumayunithi em
kuya rem
ezintweni eziningi, izitayela zesixhumanisi, nokusetha kabusha izinto eziningi zefomu.
- Kuhanjiswe zonke
.text-
izinsiza_utilities.scss
kufayela. - Yehlisiwe
.page-header
njengoba izitayela zayo zingasetshenziswa ngezinsiza. .dl-horizontal
wehlisiwe. Esikhundleni salokho, sebenzisa.row
futhi<dl>
usebenzise amakilasi ekholomu yegridi (noma imiksi) kuyo<dt>
kanye<dd>
nezingane.- Ama-blockquotes adizayinwe kabusha, asusa izitayela zawo
<blockquote>
entweni aye esigabeni esisodwa,.blockquote
. Kwehliswe.blockquote-reverse
isilungisi sezinsiza zombhalo. .list-inline
manje idinga ukuthi izingane zayo zohlu lwezinto zibe nesigaba esisha.list-inline-item
esisetshenziswe kuzo.
- Iqanjwe kabusha
.img-responsive
kwaba.img-fluid
. - Iqanjwe kabusha
.img-rounded
kwaba.rounded
- Iqanjwe kabusha
.img-circle
kwaba.rounded-circle
- Cishe zonke izimo
>
zesikhethi zisusiwe, okusho ukuthi amathebula afakwe esidlekeni manje azothola ifa ngokuzenzakalela izitayela kubazali bawo. Lokhu kwenza kube lula kakhulu ukukhetha kwethu kanye nokwenza ngokwezifiso okungaba khona. - Iqanjwe kabusha
.table-condensed
kwaba.table-sm
ukuhambisana. - Kwengezwe
.table-inverse
inketho entsha. - Kwengezwe izilungisi zesihloko sethebula:
.thead-default
kanye.thead-inverse
. - Kuqanjwe kabusha amakilasi omongo ukuze abe
.table-
nesiqalo -. Ngakho.active
,.success
,.warning
,.danger
futhi , , , kanye ..info
_.table-active
.table-success
.table-warning
.table-danger
.table-info
- I-elementi ehanjisiwe isethwe kabusha
_reboot.scss
kufayela. - Iqanjwe kabusha
.control-label
kwaba.col-form-label
. - Kuqanjwe kabusha
.input-lg
futhi.input-sm
kuya.form-control-lg
futhi.form-control-sm
, ngokulandelana. - Amakilasi awehlisiwe
.form-group-*
ngenxa yokwenza lula. Sebenzisa.form-control-*
amakilasi esikhundleni manje. - Iwiswe
.help-block
futhi esikhundleni sayo kwafakwa.form-text
umbhalo wosizo weleveli yebhulokhi. Ngombhalo wosizo we-inline nezinye izinketho ezivumelana nezimo, sebenzisa amakilasi osizo afana.text-muted
. - Yehla
.radio-inline
futhi.checkbox-inline
. - Kuhlanganiswe
.checkbox
futhi.radio
kube kanye namakilasi.form-check
ahlukahlukene ..form-check-*
- Amafomu avundlile alungisiwe:
- Yehlisa
.form-horizontal
imfuneko yekilasi. .form-group
ayisasebenzi izitayela ezivela ku-.row
mixin, ngakho.row
-ke kuyadingeka manje ekuhlelweni kwegridi evundlile (isb,<div class="form-group row">
).- Kwengezwe
.col-form-label
ikilasi elisha kumalebula amaphakathi aqondile ano-.form-control
s. - Kwengezwe okusha
.form-row
kwezakhiwo zefomu elihlangene ngezigaba zegridi (shintshanisa eyakho.row
ukuze uthole u-a.form-row
bese uhamba).
- Yehlisa
- Ukwesekwa kwamafomu ngokwezifiso angeziwe (kumabhokisi okuhlola, imisakazo, okukhethiwe, nokokufaka kwefayela).
- Kufakwe esikhundleni
.has-error
,.has-warning
, kanye.has-success
namakilasi ngokuqinisekiswa kwefomu le-HTML5 kusetshenziswa ama-CSS:invalid
namakilasi:valid
-mbumbulu. - Iqanjwe kabusha
.form-control-static
kwaba.form-control-plaintext
.
- Iqanjwe kabusha
.btn-default
kwaba.btn-secondary
. - Ilahle
.btn-xs
ikilasi ngokuphelele njengoba.btn-sm
incane kakhulu kune-v3's. - Isici senkinobho ebabazekayo se-
button.js
plugin ye-jQuery silahliwe. Lokhu kuhlanganisa$().button(string)
nezindlela$().button('reset')
. Seluleka ukusebenzisa i-JavaScript encane yangokwezifiso esikhundleni salokho, ezoba nenzuzo yokuziphatha ngendlela ofisa ngayo.- Qaphela ukuthi ezinye izici ze-plugin (izinkinobho zokuhlola amabhokisi, izinkinobho zamarediyo, izinkinobho zokuguqula okukodwa) zigcinwe ku-v4.
- Shintsha izinkinobho'
[disabled]
zibe:disabled
njengoba i-IE9+ isekela:disabled
. Nokhofieldset[disabled]
kusadingeka ngenxa yokuthi ama-fieldsets omdabu akhubazekile aseyi-buggy ku-IE11 .
- Bhala kabusha ingxenye nge-flexbox.
- Kususiwe
.btn-group-justified
. Njengokumiselela ungasebenzisa<div class="btn-group d-flex" role="group"></div>
njengesisonga ezizungeze izakhi nge-.w-100
. - Ulahle
.btn-group-xs
ikilasi ngokuphelele unikezwe ukususwa.btn-xs
. - Kukhishwe isikhala esisobala phakathi kwamaqembu ezinkinobho kumabha wamathuluzi enkinobho; sebenzisa izinsiza ze-margin manje.
- Amadokhumenti athuthukisiwe ukuze asetshenziswe nezinye izingxenye.
- Kushintshwe kusukela kubakhethi babazali kuya kumakilasi ahlukene kuzo zonke izingxenye, izilungisi, njll.
- Izitayela zokudonsela phansi ezenziwe lula ukuze zingasahambisi ngemicibisholo ebheke phezulu noma eya phansi enamathiselwe kumenyu eyehlayo.
- Okwehliswayo kungakhiwa nge-
<div>
s noma<ul>
s manje. <a>
Yakha kabusha izitayela zokudonsela phansi kanye nemakhaphu ukuze unikeze usekelo olulula, olwakhelwe ngaphakathi<button>
lwezinto ezidonsela phansi nezisekelwe.- Iqanjwe kabusha
.divider
kwaba.dropdown-divider
. - Izinto ezidonsela phansi manje zidinga
.dropdown-item
. - Ukuguqula okwehlisayo akusadingi okubekela sobala
<span class="caret"></span>
; lokhu manje kunikezwa ngokuzenzakalelayo nge-CSS's::after
ku-.dropdown-toggle
.
- Kwengezwe i-breakpoint entsha
576px
yegridi njengokuthism
, okusho ukuthi manje sekunesamba sezigaba ezinhlanu (xs
,sm
,md
,lg
, kanyexl
). - Kuqanjwe kabusha amakilasi egridi ephendulayo ukusuka
.col-{breakpoint}-{modifier}-{size}
kuye kuye.{modifier}-{breakpoint}-{size}
kumakilasi egridi alula. - Amakilasi okuguqula nokudonsa kwehlisiwe amakilasi anamandla e -flexbox
order
. Isibonelo, esikhundleni sokuthi.col-8.push-4
futhi.col-4.pull-8
, ungasebenzisa.col-8.order-2
futhi.col-4.order-1
. - Kungezwe amakilasi okusetshenziswa kwe-flexbox yesistimu yegridi nezingxenye.
- Bhala kabusha ingxenye nge-flexbox.
- Kuthathelwe
a.list-group-item
indawo ikilasi elisobala,.list-group-item-action
, lesixhumanisi sesitayela nezinguqulo zezinkinobho zezinto zeqembu. - Ikilasi
.list-group-flush
elingeziwe elizosetshenziswa namakhadi.
- Bhala kabusha ingxenye nge-flexbox.
- Uma kubhekwa ukuhambisa ku-flexbox, ukuqondanisa kwezithonjana zokucashisa kunhlokweni cishe kuphukile njengoba singasasebenzisi okuntantayo. Okuqukethwe okuntantayo kuza kuqala, kodwa nge-flexbox akusenjalo. Buyekeza izithonjana zakho zokucashisa ukuthi zize ngemva kwezihloko ze-modal ukuze zilungiswe.
- Inketho
remote
(engase isetshenziselwe ukulayisha ngokuzenzakalela kanye nokujova okuqukethwe kwangaphandle kumodi) kanyeloaded.bs.modal
nomcimbi ohambisanayo ususiwe. Sincoma ukuthi usebenzise isifanekiso sohlangothi lweklayenti noma uhlaka olubophezela idatha, noma ushayele i-jQuery.load ngokwakho.
- Bhala kabusha ingxenye nge-flexbox.
- Kwehliswe cishe zonke
>
izikhethi ukuze kwenziwe isitayela kalula ngamakilasi angafakwanga. - Esikhundleni sezikhethi eziqondene ne-HTML ezifana
.nav > li > a
, sisebenzisa amakilasi ahlukene u-.nav
s,.nav-item
s, no-.nav-link
s. Lokhu kwenza i-HTML yakho ivumelane nezimo kakhulu ngenkathi iletha ukwanda okunwetshiwe.
I-navbar ibhalwe kabusha ngokuphelele ku-flexbox ngokusekelwa okuthuthukisiwe kokuqondanisa, ukuphendula, nokwenza ngendlela oyifisayo.
- Impatho ephendulayo ye-navbar manje isisetshenziswa
.navbar
ekilasini ngendlela edingekayo.navbar-expand-{breakpoint}
lapho ukhetha ukuthi ugoqe kuphi ibha ye-navbar. Ngaphambilini lokhu bekuwukuguqulwa Okuncane okuguquguqukayo futhi kudinga ukubuyiselwa kabusha. .navbar-default
manje.navbar-light
, nakuba.navbar-dark
kusafana. Okukodwa kwalokhu kuyadingeka ku-navbar ngayinye. Nokho, lezi zigaba azisasethibackground-color
s; kunalokho zithinta kuphelacolor
.- Ama-Navbar manje adinga isimemezelo sangemuva sohlobo oluthile. Khetha ezinsizeni zethu zangemuva (
.bg-*
) noma usethe okwakho ngamakilasi akhanyayo/aphambene ngenhla ukuze wenze ngokwezifiso ubuhlanya . - Njengoba kunikezwe izitayela ze-flexbox, ama-navbar manje angasebenzisa izinsiza ze-flexbox ukuze uthole izinketho zokuqondanisa kalula.
.navbar-toggle
manje.navbar-toggler
futhi inezitayela ezahlukene kanye nemakhaphu yangaphakathi (akusekho amasekhondi amathathu<span>
).- Liyeke
.navbar-form
ikilasi ngokuphelele. Akusadingeki; esikhundleni salokho, vele usebenzise.form-inline
futhi usebenzise izinsiza ze-margin njengoba kudingeka. - Ama-Navbar awasafaki
margin-bottom
nomaborder-radius
ngokuzenzakalelayo. Sebenzisa izinsiza njengoba kudingeka. - Zonke izibonelo eziqukethe ama-navbar zibuyekeziwe ukuze zifake umaka omusha.
- Bhala kabusha ingxenye nge-flexbox.
- Amakilasi acacile (
.page-item
,.page-link
) manje ayadingeka enzalweni ye-.pagination
s - Ishiye
.pager
ingxenye ngokuphelele njengoba ibingaphezulu kancane kwezinkinobho zohlaka ezenziwe ngokwezifiso.
- Isigaba esicacile,
.breadcrumb-item
, manje siyadingeka enzalweni ye-.breadcrumb
s
- Kuhlanganiswe
.label
futhi.badge
kuhlukaniswe kusuka ku-<label>
elementi nokwenza lula izingxenye ezihlobene. - Kwengezwe
.badge-pill
njengesilungisi sokubukeka “kwephilisi” eliyindilinga. - Amabheji awasantanti ngokuzenzakalelayo emaqenjini ohlu nezinye izingxenye. Amakilasi ezinsiza manje ayadingeka kulokho.
.badge-default
Kwehlisiwe futhi.badge-secondary
kwengezwa kumakilasi okuguqula ingxenye asetshenziswa kwenye indawo.
Ilahliwe ngokuphelele engxenyeni yekhadi entsha.
.panel
kuya ku-.card
, manje yakhiwe nge-flexbox..panel-default
isusiwe futhi akukho okushintshwayo..panel-group
isusiwe futhi akukho okushintshwayo..card-group
akusiyo enye indawo, kuhlukile..panel-heading
ku.card-header
.panel-title
ku.card-title
. Kuye ngokubukeka okufunayo, ungase futhi ufune ukusebenzisa izakhi zesihloko noma amakilasi (isb<h3>
,.h3
) noma izakhi ezigqamile noma amakilasi (isb<strong>
,<b>
,.font-weight-bold
). Qaphela ukuthi.card-title
, ngenkathi iqanjwe ngendlela efanayo, ikhiqiza ukubukeka okuhlukile kune-.panel-title
..panel-body
ku.card-body
.panel-footer
ku.card-footer
.panel-primary
,.panel-success
, ,.panel-info
,.panel-warning
, futhi.panel-danger
kwehlisiwe ku-.bg-
,.text-
, kanye.border
nezinsiza ezenziwe$theme-colors
kumephu yethu ye-Sass.
- Kushintshwe
.progress-bar-*
amakilasi anomongo ngezinsiza.bg-*
. Ngokwesibonelo,class="progress-bar progress-bar-danger"
ibaclass="progress-bar bg-danger"
. - Kufakwe esikhundleni
.active
semishayo yenqubekelaphambili egqwayizayo ene-.progress-bar-animated
.
- Kulungiswe kabusha yonke ingxenye ukuze kube lula ukuklama nokwenza isitayela. Sinezitayela ezimbalwa ongazibhala ngaphezulu, izinkomba ezintsha, nezithonjana ezintsha.
- Yonke i-CSS ayifakwanga isidleke futhi yaqanjwa kabusha, okuqinisekisa ukuthi ikilasi ngalinye linesiqalo esithi
.carousel-
.- Okwezinto ze-carousel,
.next
,.prev
,.left
, futhi.right
manje.carousel-item-next
,.carousel-item-prev
,.carousel-item-left
, kanye.carousel-item-right
. .item
nayo manje.carousel-item
.- Ezilawulini ezandulele/ezilandelayo,
.carousel-control.right
futhi.carousel-control.left
manje.carousel-control-next
futhi.carousel-control-prev
, okusho ukuthi azisadingi isigaba sesisekelo esithile.
- Okwezinto ze-carousel,
- Isuse sonke isitayela esisabelayo, ihlehlisa izinsiza (isb, ukubonisa amagama-ncazo ezikhumulweni zokubuka ezithile) nezitayela zangokwezifiso njengoba kudingeka.
- Ukukhishwa kwesithombe okususiwe ezithombeni zezinto ze-carousel, kuhlehliselwa izinsiza.
- Kulungiswe isibonelo se-Carousel ukuze sifake umaka nezitayela ezintsha.
- Kususwe usekelo lwamatafula anesitayela esidleke. Zonke izitayela zethebula manje sezizuzwe njengefa ku-v4 kubakhethi abalula.
- Kwengezwe okuhlukile kwethebula eliphambene.
- Bonisa, kufihliwe, nokuningi:
- Yenza izinsiza zokubonisa ziphendule (isb,
.d-none
kanyed-{sm,md,lg,xl}-none
). - Dropped the bulk of
.hidden-*
utilities for new display utilities. For example, instead of.hidden-sm-up
, use.d-sm-none
. Renamed the.hidden-print
utilities to use the display utility naming scheme. More info under the Responsive utilities section of this page. - Added
.float-{sm,md,lg,xl}-{left,right,none}
classes for responsive floats and removed.pull-left
and.pull-right
since they’re redundant to.float-left
and.float-right
.
- Yenza izinsiza zokubonisa ziphendule (isb,
- Type:
- Added responsive variations to our text alignment classes
.text-{sm,md,lg,xl}-{left,center,right}
.
- Added responsive variations to our text alignment classes
- Alignment and spacing:
- Added new responsive margin and padding utilities for all sides, plus vertical and horizontal shorthands.
- Added boatload of flexbox utilities.
- Dropped
.center-block
for the new.mx-auto
class.
- Clearfix updated to drop support for older browser versions.
Bootstrap 3’s vendor prefix mixins, which were deprecated in v3.2.0, have been removed in Bootstrap 4. Since we use Autoprefixer, they’re no longer necessary.
Removed the following mixins: animation
, animation-delay
, animation-direction
, animation-duration
, animation-fill-mode
, animation-iteration-count
, animation-name
, animation-timing-function
, backface-visibility
, box-sizing
, content-columns
, hyphens
, opacity
, perspective
, perspective-origin
, rotate
, rotateX
, rotateY
, scale
, scaleX
, scaleY
, skew
, transform-origin
, transition-delay
, transition-duration
, transition-property
, transition-timing-function
, transition-transform
, translate
, translate3d
, user-select
Our documentation received an upgrade across the board as well. Here’s the low down:
- We’re still using Jekyll, but we have plugins in the mix:
bugify.rb
is used to efficiently list out the entries on our browser bugs page.example.rb
is a custom fork of the defaulthighlight.rb
plugin, allowing for easier example-code handling.callout.rb
is a similar custom fork of that, but designed for our special docs callouts.- jekyll-toc is used to generate our table of contents.
- All docs content has been rewritten in Markdown (instead of HTML) for easier editing.
- Pages have been reorganized for simpler content and a more approachable hierarchy.
- We moved from regular CSS to SCSS to take full advantage of Bootstrap’s variables, mixins, and more.
All @screen-
variables have been removed in v4.0.0. Use the media-breakpoint-up()
, media-breakpoint-down()
, or media-breakpoint-only()
Sass mixins or the $grid-breakpoints
Sass map instead.
Our responsive utility classes have largely been removed in favor of explicit display
utilities.
- The
.hidden
and.show
classes have been removed because they conflicted with jQuery’s$(...).hide()
and$(...).show()
methods. Instead, try toggling the[hidden]
attribute or use inline styles likestyle="display: none;"
andstyle="display: block;"
. - All
.hidden-
classes have been removed, save for the print utilities which have been renamed.- Removed from v3:
.hidden-xs
.hidden-sm
.hidden-md
.hidden-lg
.visible-xs-block
.visible-xs-inline
.visible-xs-inline-block
.visible-sm-block
.visible-sm-inline
.visible-sm-inline-block
.visible-md-block
.visible-md-inline
.visible-md-inline-block
.visible-lg-block
.visible-lg-inline
.visible-lg-inline-block
- Removed from v4 alphas:
.hidden-xs-up
.hidden-xs-down
.hidden-sm-up
.hidden-sm-down
.hidden-md-up
.hidden-md-down
.hidden-lg-up
.hidden-lg-down
- Removed from v3:
- Print utilities no longer start with
.hidden-
or.visible-
, but with.d-print-
.- Old names:
.visible-print-block
,.visible-print-inline
,.visible-print-inline-block
,.hidden-print
- Amakilasi amasha:
.d-print-block
,.d-print-inline
,.d-print-inline-block
,.d-print-none
- Old names:
Kunokuba usebenzise .visible-*
amakilasi asobala, wenza into ibonakale ngokungafihli kulowo sayizi wesikrini. Ungahlanganisa .d-*-none
ikilasi elilodwa nekilasi elilodwa .d-*-block
ukuze ubonise into ethile kuphela ngesikhawu esinikeziwe samasayizi wesikrini (isb .d-none.d-md-block.d-xl-none
. kubonisa isici kuphela kumadivayisi aphakathi nendawo namakhulu).
Qaphela ukuthi izinguquko kuma-breakpoints egridi ku-v4 zisho ukuthi uzodinga ukuya endaweni eyodwa enkulu ukuze uzuze imiphumela efanayo. Amakilasi ensiza esabelayo amasha awazami ukwamukela izimo ezingajwayelekile lapho ukubonakala kwesici kungakwazi ukuvezwa njengobubanzi obubodwa obuhambisanayo bosayizi bembobo yokubuka; uzodinga ukusebenzisa i-CSS yangokwezifiso ezimweni ezinjalo.