Hijira zuwa v5
Bi da bitar canje-canje ga fayilolin tushen Bootstrap, takardu, da abubuwan haɗin gwiwa don taimaka muku ƙaura daga v4 zuwa v5.
v5.2.0
An sabunta ƙira
Bootstrap v5.2.0 yana fasalta sabuntawar ƙira da dabara don ɗimbin kayan gyara da kaddarorin a cikin aikin, musamman ta hanyar ingantaccen ƙima border-radius
akan maɓalli da sarrafa tsari . Har ila yau, an sabunta takaddun mu tare da sabon shafin gida, shimfidar takardu mafi sauƙi waɗanda ba su sake rushe sassan labarun gefe, da ƙarin fitattun misalan Bootstrap Icons .
Ƙarin masu canji na CSS
Mun sabunta duk abubuwan da muka gyara don amfani da masu canjin CSS. Duk da yake Sass har yanzu yana tallafawa komai, kowane bangare an sabunta shi don haɗa masu canjin CSS akan azuzuwan tushe (misali, .btn
), yana ba da damar ƙarin gyare-gyaren Bootstrap na ainihin lokaci. A cikin fitowar ta gaba, za mu ci gaba da faɗaɗa amfani da masu canjin CSS zuwa cikin shimfidar wuri, fom, mataimaka, da abubuwan amfani. Kara karantawa game da masu canji na CSS a kowane bangare akan shafuffukan takardun su.
Amfanin mu na CSS masu canzawa ba zai ɗan cika ba har sai Bootstrap 6. Yayin da muke son aiwatar da waɗannan gabaɗaya a cikin hukumar, suna cikin haɗarin haifar da sauye-sauye. Misali, saitin $alert-border-width: var(--bs-border-width)
a lambar tushen mu yana karya yuwuwar Sass a cikin lambar ku idan kuna yin $alert-border-width * 2
wani dalili.
Don haka, duk inda zai yiwu, za mu ci gaba da turawa zuwa ƙarin masu canjin CSS, amma da fatan za a gane aiwatar da mu na iya ɗan iyakancewa a cikin v5.
Sabo_maps.scss
Bootstrap v5.2.0 ya gabatar da sabon fayil ɗin Sass tare da _maps.scss
. Yana fitar da taswirorin Sass da yawa daga _variables.scss
don gyara matsala inda ba a yi amfani da sabuntawa zuwa taswira ta asali zuwa taswirorin sakandare waɗanda ke tsawaita su ba. Misali, $theme-colors
ba a yin amfani da sabuntawa zuwa ga wasu taswirorin jigo waɗanda suka dogara da su $theme-colors
, ƙetare maɓalli na gyare-gyaren ayyukan aiki. A takaice, Sass yana da iyaka inda da zarar an yi amfani da tsoho ko taswira , ba za a iya sabunta shi ba. Akwai irin wannan gazawar tare da masu canjin CSS lokacin da aka yi amfani da su don tsara wasu masu canjin CSS.
Wannan shine dalilin da ya sa canje-canje masu canzawa a cikin Bootstrap dole ne su zo bayan @import "functions"
, amma kafin @import "variables"
da sauran tarin shigo da mu. Hakanan ya shafi taswirorin Sass-dole ne ku soke abubuwan da ba a so kafin a yi amfani da su. An matsar da taswirori masu zuwa zuwa sabon _maps.scss
:
$theme-colors-rgb
$utilities-colors
$utilities-text
$utilities-text-colors
$utilities-bg
$utilities-bg-colors
$negative-spacers
$gutters
Gina Bootstrap CSS na al'ada ya kamata yanzu yayi kama da wannan tare da shigo da taswira daban.
// 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
Sabbin kayan aiki
- Fadada
font-weight
abubuwan amfani don haɗawa.fw-semibold
don manyan haruffa masu ƙarfi. - Fadada
border-radius
kayan aiki don haɗa sabbin masu girma dabam biyu,.rounded-4
da.rounded-5
, don ƙarin zaɓuɓɓuka.
Ƙarin canje-canje
-
Gabatar da sabon
$enable-container-classes
zaɓi. - Yanzu lokacin shiga cikin shimfidar Grid na gwaji na CSS,.container-*
har yanzu za a haɗa azuzuwan, sai dai idan an saita wannan zaɓi zuwafalse
. Kwantena kuma yanzu suna kiyaye ƙimar gutter ɗin su. -
Bangaren Offcanvas yanzu yana da bambance-bambancen amsawa . Asalin
.offcanvas
aji ya kasance baya canzawa - yana ɓoye abun ciki a duk wuraren kallo. Don mayar da martani, canza wannan.offcanvas
ajin zuwa kowane.offcanvas-{sm|md|lg|xl|xxl}
aji. -
Masu raba tebur masu kauri yanzu sun shiga. - Mun cire mafi kauri kuma mafi wahala don tsallake iyaka tsakanin rukunin tebur kuma mun matsar da shi zuwa aji na zaɓi wanda zaku iya nema,
.table-group-divider
. Dubi takaddun tebur don misali. -
An sake rubuta Scrollspy don amfani da Intersection Observer API , wanda ke nufin ba kwa buƙatar dangi na dangi, ƙaddamar
offset
da saiti, da ƙari. Nemo aiwatar da Scrollspy ɗinku don zama daidai da daidaito a cikin nunin nav ɗin su. -
Popovers da kayan aiki yanzu suna amfani da masu canji na CSS. Wasu masu canjin CSS an sabunta su daga takwarorinsu na Sass don rage yawan masu canji. Sakamakon haka, an soke masu canji guda uku a cikin wannan sakin:
$popover-arrow-color
,$popover-arrow-outer-color
, da$tooltip-arrow-color
. -
An ƙara sabbin
.text-bg-{color}
mataimaka. Maimakon saita daidaikun mutane.text-*
da.bg-*
abubuwan amfani, yanzu zaku iya amfani da.text-bg-*
mataimaka don saitabackground-color
gaba mai bambantacolor
. -
Ƙara
.form-check-reverse
gyare-gyare don jujjuya tsari na lakabi da akwatunan rajistan shiga/radiyo masu alaƙa. -
Ƙara ginshiƙai masu tsiri suna goyan bayan tebur ta sabon
.table-striped-columns
aji.
Don cikakken jerin canje-canje, duba aikin v5.2.0 akan GitHub .
v5.1.0
-
Ƙara goyan bayan gwaji don shimfidar Grid na CSS . - Wannan aiki ne na ci gaba, kuma har yanzu bai shirya don amfani da samarwa ba, amma kuna iya shiga sabon fasalin ta hanyar Sass. Don kunna shi, musaki tsoho grid, ta saiti
$enable-grid-classes: false
kuma kunna Grid na CSS ta saitin$enable-cssgrid: true
. -
Sabunta navbars don tallafawa kashe canvas. - Ƙara masu zanen bango a cikin kowane mashaya navbar tare da
.navbar-expand-*
azuzuwan masu amsawa da wasu alamar tazara. -
An ƙara sabon ɓangaren mai riƙe wuri . - Sabon fasalin mu, hanya don samar da tubalan wucin gadi a madadin ainihin abun ciki don taimakawa nuna cewa har yanzu wani abu yana lodawa a cikin rukunin yanar gizonku ko app.
-
Rushe plugin yanzu yana goyan bayan rushewar kwance . - Ƙara
.collapse-horizontal
zuwa.collapse
ga rushewarwidth
maimakonheight
. Guji gyara mai lilo ta hanyar saitamin-height
koheight
. -
An ƙara sabon tari da mataimakan doka na tsaye. - Yi amfani da kaddarorin flexbox da sauri don ƙirƙirar shimfidu na al'ada da sauri tare da tari . Zaɓi daga likafai na kwance (
.hstack
) da na tsaye (.vstack
) . Ƙara masu rarraba tsaye kama da<hr>
abubuwa tare da sababbin.vr
mataimaka . -
An ƙara sabbin
:root
masu canjin CSS na duniya. - An ƙara sabbin masu canjin CSS da yawa zuwa:root
matakin sarrafa<body>
salo. Ƙarin suna cikin ayyukan, gami da ko'ina cikin abubuwan amfaninmu da abubuwan haɗin gwiwarmu, amma a yanzu karanta masu canjin CSS a cikin Sashen Gyara . -
Ƙunƙarar launi da abubuwan amfani na bango don amfani da masu canji na CSS, kuma sun ƙara sabon saƙon rubutu da bayanan bayanan bayanan . -
.text-*
kuma.bg-*
yanzu an gina kayan aiki tare da masu canji na CSS dargba()
ƙimar launi, yana ba ku damar keɓance kowane kayan aiki cikin sauƙi tare da sabbin abubuwan amfani. -
An ƙara sabbin misalan snippet bisa tushen don nuna yadda ake keɓance kayan aikin mu. - Ja da shirye don amfani da abubuwan da aka keɓance da sauran ƙirar ƙira na gama gari tare da sabbin misalan Snippets ɗin mu . Ya haɗa da ƙafafu , zazzagewa , ƙungiyoyin jeri , da tsari .
-
An cire salon sanyawa da ba a yi amfani da su ba daga faɗuwa da kayan aiki kamar yadda Popper ke sarrafa waɗannan kawai.
$tooltip-margin
an yanke shi kuma an saita shinull
a cikin tsari.
Kuna son ƙarin bayani? Karanta gidan yanar gizon v5.1.0.
Dogara
- An sauke jQuery.
- An haɓaka daga Popper v1.x zuwa Popper v2.x.
- Maye gurbin Libsass tare da Dart Sass kamar yadda mai tara Sass ɗin mu da aka ba Libsas ya ƙare.
- Yi ƙaura daga Jekyll zuwa Hugo don gina takaddun mu
Tallafin mai lilo
- An sauke Internet Explorer 10 da 11
- An sauke Microsoft Edge <16 (Legacy Edge)
- An sauke Firefox <60
- Safari da aka sauke <12
- An sauke iOS Safari <12
- An sauke Chrome <60
Canje-canjen takardu
- Sake tsara shafin gida, shimfidar takardu, da ƙafa.
- An ƙara sabon jagorar Parcel .
- An ƙara sabon sashe keɓancewa , maye gurbin v4's Theming page , tare da sabbin bayanai akan Sass, zaɓin daidaitawa na duniya, tsarin launi, masu canjin CSS, da ƙari.
- Sake tsara duk takardun tsari zuwa sabon sashe na Forms , raba abubuwan cikin abubuwan da aka fi mayar da hankali.
- Hakazalika, an sabunta sashin Layout , don fitar da abun cikin grid a sarari.
- Sake suna "Navs" shafin bangaren zuwa "Navs & Tabs".
- Sake sunan shafin "Checks" zuwa "Checks & Rediyo".
- Sake tsara navbar kuma ya ƙara sabon subnav don sauƙaƙa kewaya rukunin yanar gizon mu da nau'ikan takardu.
- Ƙara sabon gajeriyar hanyar madannai don filin bincike: Ctrl + /.
Sass
-
Mun kawar da tsohowar taswirar Sass don sauƙaƙa cire ƙimar ƙima. Ka tuna cewa yanzu dole ne ka ayyana duk dabi'u a cikin taswirar Sass kamar
$theme-colors
. Duba yadda ake mu'amala da taswirorin Sass . -
KaryewaAyyukan da aka sake suna
color-yiq()
da masu alaƙa da sucolor-contrast()
kamar yadda baya da alaƙa da sararin launi na YIQ. Duba #30168.$yiq-contrasted-threshold
an sake masa suna zuwa$min-contrast-ratio
.$yiq-text-dark
kuma$yiq-text-light
an sake masa suna zuwa$color-contrast-dark
da$color-contrast-light
.
-
KaryewaMembobin tambayar mediya mixins sun canza don mafi ma'ana.
media-breakpoint-down()
yana amfani da wurin karyewa kanta a maimakon wurin hutu na gaba (misali,media-breakpoint-down(lg)
maimakonmedia-breakpoint-down(md)
maƙasudin kallon ƙasa dalg
).- Hakazalika, ma'auni na biyu a ciki
media-breakpoint-between()
shima yana amfani da madaidaicin wurin da kansa maimakon wuri na gaba (misali,media-between(sm, lg)
maimakonmedia-breakpoint-between(sm, md)
maƙasudin ra'ayi tsakaninsm
dalg
).
-
KaryewaSalon bugu da aka cire da
$enable-print-styles
masu canji. Har yanzu azuzuwan nuni suna nan a kusa. Duba #28339 . -
KaryewaSauke
color()
,theme-color()
, dagray()
ayyuka don goyon bayan masu canji. Duba #29083 . -
KaryewaAyyukan da aka sake suna
theme-color-level()
zuwacolor-level()
kuma yanzu yana karɓar kowane launi da kuke so maimakon kawai$theme-color
launuka. Duba #29083 A kula:color-level()
daga baya aka shigav5.0.0-alpha3
. -
KaryewaSake suna
$enable-prefers-reduced-motion-media-query
kuma$enable-pointer-cursor-for-buttons
zuwa$enable-reduced-motion
kuma$enable-button-pointers
don taƙaitawa. -
KaryewaAn cire abin haɗin
bg-gradient-variant()
. Yi amfani da.bg-gradient
ajin don ƙara gradients zuwa abubuwa maimakon.bg-gradient-*
azuzuwan da aka ƙirƙira. -
Karyewa Abubuwan da aka cire a baya waɗanda aka soke:
hover
,hover-focus
,plain-hover-focus
, kumahover-focus-active
float()
form-control-mixin()
nav-divider()
retina-img()
text-hide()
(kuma ya watsar da aji mai alaƙa,.text-hide
)visibility()
form-control-focus()
-
KaryewaSake suna
scale-color()
donshift-color()
gujewa karo tare da aikin sikelin launi na Sass. -
box-shadow
mixins yanzu suna ba da damar ƙimanull
da faɗuwanone
daga mahawara da yawa. Duba #30394 . -
Mixin
border-radius()
yanzu yana da ƙimar tsoho.
Tsarin launi
-
Tsarin launi wanda yayi aiki tare
color-level()
kuma$theme-color-interval
an cire shi don goyon bayan sabon tsarin launi. Duklighten()
dadarken()
ayyuka a cikin codebase an maye gurbinsutint-color()
dashade-color()
. Wadannan ayyuka za su haɗu da launi tare da ko dai fari ko baki maimakon canza haskensa ta ƙayyadadden adadin. So ko daishift-color()
tint ko inuwa launi dangane da ko ma'aunin nauyin sa yana da kyau ko mara kyau. Duba #30622 don ƙarin bayani. -
Ƙara sabon tints da inuwa don kowane launi, yana ba da launuka daban-daban guda tara don kowane launi na tushe, azaman sabbin masu canji na Sass.
-
Ingantattun bambancin launi. Matsakaicin bambancin launi da aka samu daga 3:1 zuwa 4.5:1 da sabunta shuɗi, kore, cyan, da launuka masu ruwan hoda don tabbatar da bambancin WCAG 2.1 AA. Hakanan ya canza launin bambancin launin mu daga
$gray-900
zuwa$black
. -
Don tallafawa tsarin launi na mu, mun ƙara sabbin al'ada
tint-color()
dashade-color()
ayyuka don haɗa launukanmu yadda ya kamata.
Sabuntawar Grid
-
Sabuwar wurin karyewa! An ƙara sabon wurin
xxl
warwarewa don1400px
da sama. Babu canje-canje ga duk sauran wuraren karyawa. -
Ingantattun gutters. Yanzu an saita magudanar ruwa a cikin rems, kuma sun fi kunkuntar v4 (
1.5rem
, ko kusan24px
, ƙasa daga30px
). Wannan yana daidaita magudanar ruwa na tsarin grid ɗinmu tare da abubuwan amfaninmu na tazara.- An ƙara sabon ajin gutter (
.g-*
,.gx-*
, da.gy-*
) don sarrafa magudanar ruwa a kwance/tsaye, magudanar ruwa, da magudanan ruwa na tsaye. - KaryewaAn sake suna
.no-gutters
don.g-0
dacewa da sabbin kayan aikin gutter.
- An ƙara sabon ajin gutter (
-
ginshiƙai ba su ƙara yin
position: relative
amfani da su ba, don haka ƙila ka ƙara.position-relative
zuwa wasu abubuwa don maido da wannan ɗabi'ar. -
KaryewaAn
.order-*
sauke darussa da yawa waɗanda galibi ba a yi amfani da su ba. Yanzu muna samar.order-1
da kawai.order-5
daga cikin akwatin. -
KaryewaAn jefar da
.media
bangaren saboda ana iya kwafi shi cikin sauƙi tare da kayan aiki. Dubi #28265 da shafi mai sassauƙa don misali . -
Karyewa
bootstrap-grid.css
yanzu kawai ya shafibox-sizing: border-box
shafi maimakon sake saita girman akwatin duniya. Ta wannan hanyar, ana iya amfani da salon grid ɗin mu a ƙarin wurare ba tare da tsangwama ba. -
$enable-grid-classes
ba ya ƙara kashe ƙarni na azuzuwan kwantena. Duba #29146. -
An sabunta
make-col
mahaɗin zuwa tsoho zuwa daidaitattun ginshiƙai ba tare da ƙayyadadden girman ba.
Abun ciki, Sake yi, da sauransu
-
RFS yanzu an kunna ta tsohuwa. Kanun labarai da ke amfani da
font-size()
mahaɗin za su daidaita su ta atomatikfont-size
zuwa sikelin su tare da wurin kallo. An riga an shigar da wannan fasalin tare da v4. -
KaryewaAn sabunta rubutun mu don maye gurbin
$display-*
masu canjin mu da$display-font-sizes
taswirar Sass. Hakanan an cire masu$display-*-weight
canji guda ɗaya don s guda ɗaya$display-font-weight
da daidaitaccefont-size
. -
An ƙara sabbin
.display-*
masu girma dabam biyu,.display-5
da.display-6
. -
Ana yin layi ta hanyar haɗin kai ta tsohuwa (ba kawai a kan motsi ba), sai dai idan sun kasance ɓangare na takamaiman abubuwan da aka gyara.
-
Sake tsara teburi don sabunta salon su da sake gina su tare da masu canjin CSS don ƙarin iko akan salo.
-
KaryewaTebura masu gida ba su gaji salo kuma.
-
Karyewa
.thead-light
kuma.thead-dark
an jefar da su ga.table-*
bambance-bambancen azuzuwan waɗanda za a iya amfani da su don duk abubuwan tebur (thead
,tbody
,tfoot
,tr
,th
datd
). -
KaryewaAn
table-row-variant()
sake sanya wa mixin sunatable-variant()
kuma yana karɓar sigogi 2 kawai:$color
(sunan launi) da$value
(lambar launi). Ana ƙididdige launi na kan iyaka da launukan lafazi ta atomatik bisa ma'auni na tebur. -
Rarraba masu canjin tantanin halitta na tebur zuwa
-y
da-x
. -
KaryewaAn sauke darasi
.pre-scrollable
. Duba #29135 -
Karyewa
.text-*
abubuwan amfani ba sa ƙara jujjuyawa da jahohin mayar da hankali ga hanyoyin haɗin gwiwa kuma..link-*
Za a iya amfani da azuzuwan taimako maimakon. Duba #29267 -
KaryewaAn sauke darasi
.text-justify
. Duba #29793 -
Karyewa
<hr>
abubuwa yanzu suna amfani da suheight
maimakonborder
don ingantasize
sifa. Wannan kuma yana ba da damar yin amfani da kayan aikin padding don ƙirƙirar masu rarraba masu kauri (misali,<hr class="py-1">
). -
Sake saita tsoho a kwance
padding-left
a kunne<ul>
da<ol>
abubuwa daga tsohowar burauza40px
zuwa2rem
. -
Ƙara
$enable-smooth-scroll
, wanda ya shafiscroll-behavior: smooth
duniya-sai dai masu amfani da ke neman rage motsi ta hanyarprefers-reduced-motion
tambayar kafofin watsa labaru. Duba #31877
RTL
- Takaitaccen madaidaicin jagorar madaidaiciya, kayan aiki, da mixins duk an sake canza suna don amfani da kaddarorin ma'ana kamar waɗanda aka samo a cikin shimfidar flexbox-misali,
start
kumaend
a madadinleft
daright
.
Siffofin
-
An ƙara sabbin siffofin iyo! Mun inganta misalin alamun tambarin ruwa zuwa cikakken goyan bayan nau'ikan tsari. Duba sabon shafin lakabin iyo.
-
Karyewa Haɓaka abubuwan asali na asali da na al'ada. Akwatunan bincike, rediyo, zaɓaɓɓu, da sauran abubuwan shigar da ke da azuzuwan asali da na al'ada a cikin v4 an haɗa su. Yanzu kusan dukkanin nau'ikan nau'ikan mu gabaɗayan al'ada ne, galibi ba tare da buƙatar HTML na al'ada ba.
.custom-control.custom-checkbox
yana yanzu.form-check
..custom-control.custom-custom-radio
yana yanzu.form-check
..custom-control.custom-switch
yana yanzu.form-check.form-switch
..custom-select
yana yanzu.form-select
..custom-file
kuma.form-file
an maye gurbinsu da salon al'ada a saman.form-control
..custom-range
yana yanzu.form-range
.- An sauke ɗan ƙasa
.form-control-file
kuma.form-control-range
.
-
KaryewaAn sauke
.input-group-append
kuma.input-group-prepend
. Yanzu zaku iya ƙara maɓalli kawai kuma.input-group-text
azaman yaran ƙungiyoyin shigarwa kai tsaye. -
Tsawon radiyon kan iyaka da aka rasa akan rukunin shigarwa tare da bugu mai inganci an daidaita shi a ƙarshe ta ƙara ƙarin
.has-validation
aji zuwa ƙungiyoyin shigarwa tare da inganci. -
Karyewa An sauke takamaiman azuzuwan shimfidar wuri don tsarin grid ɗin mu. Yi amfani da grid da abubuwan amfani maimakon
.form-group
,.form-row
, ko.form-inline
. -
KaryewaAlamun sigar yanzu suna buƙatar
.form-label
. -
Karyewa
.form-text
no longer setsdisplay
, yana ba ku damar ƙirƙirar layi ko toshe rubutun taimako kamar yadda kuke so kawai ta canza abubuwan HTML. -
Ba a daina amfani da sarrafa fom gyarawa
height
lokacin da zai yiwu, maimakon jinkirtawamin-height
don haɓaka keɓancewa da dacewa tare da sauran abubuwan haɗin gwiwa. -
Ba a ƙara amfani da gumakan tabbatarwa zuwa
<select>
s tare damultiple
. -
Fayilolin Sass da aka sake tsarawa a ƙarƙashin
scss/forms/
, gami da salon shigar ƙungiyar.
Abubuwan da aka gyara
- Haɗin
padding
ƙima don faɗakarwa, gurasar burodi, katunan, zazzagewa, ƙungiyoyin jeri, modals, popovers, da tukwici na kayan aiki don dogara da$spacer
canjin mu. Duba #30564 .
Accordion
- An ƙara sabon bangaren accordion .
Fadakarwa
-
Faɗakarwa yanzu suna da misalai tare da gumaka .
-
An cire salo na al'ada don
<hr>
s a cikin kowane faɗakarwa tunda sun riga sun yi amfani dacurrentColor
.
Baji
-
KaryewaAn watsar da duk
.badge-*
nau'ikan launi don abubuwan amfani na baya (misali, amfani.bg-primary
maimakon.badge-primary
). -
KaryewaAn
.badge-pill
sauke - yi amfani da.rounded-pill
mai amfani maimakon. -
KaryewaCire shawagi da salon mayar da hankali ga abubuwa
<a>
da<button>
abubuwa. -
Ƙara tsoho madaidaicin don baji daga
.25em
/.5em
zuwa.35em
/.65em
.
Gurasa gurasa
-
Sauƙaƙe tsohowar bayyanar crumbs ta hanyar cire
padding
,background-color
, daborder-radius
. -
Ƙara sabon kadarorin CSS na al'ada
--bs-breadcrumb-divider
don sauƙaƙe keɓancewa ba tare da buƙatar sake tattara CSS ba.
Buttons
-
Karyewa Maɓallin maɓalli , tare da akwatuna ko radiyo, baya buƙatar JavaScript kuma suna da sabon alama. Ba mu ƙara buƙatar abin rufewa, ƙara
.btn-check
zuwa<input>
, da kuma haɗa shi da kowane.btn
nau'i akan<label>
. Duba #30650 . Takaddun bayanai na wannan sun ƙaura daga shafin Buttons zuwa sabon sashin Forms. -
Karyewa An sauke
.btn-block
don kayan aiki. Maimakon amfani.btn-block
da kan.btn
, kunsa maɓallan ku.d-grid
da abin.gap-*
amfani don yin sarari su yadda ake buƙata. Canja zuwa azuzuwan masu amsawa don ƙarin iko akan su. Karanta takardun don wasu misalai. -
An sabunta mu
button-variant()
dabutton-outline-variant()
mixins don tallafawa ƙarin sigogi. -
Maɓallai da aka sabunta don tabbatar da ƙarin bambanci akan jujjuyawa da jihohi masu aiki.
-
Maɓallan da aka kashe yanzu suna da
pointer-events: none;
.
Katin
-
KaryewaSauke
.card-deck
a cikin ni'imar mu grid. Kunna katunan ku a cikin azuzuwan ginshiƙi kuma ƙara.row-cols-*
akwati na iyaye don sake ƙirƙirar benen katin (amma tare da ƙarin iko akan daidaitawa). -
KaryewaAn jefar
.card-columns
da Masonry. Duba #28922 . -
KaryewaMaye gurbin
.card
tushen accordion tare da sabon bangaren Accordion .
Carousel
-
An ƙara sabon
.carousel-dark
bambance-bambancen don rubutu mai duhu, sarrafawa, da masu nuni (mai girma don bangon haske). -
Gumakan chevron da aka sauya don sarrafa carousel tare da sabbin SVGs daga gumakan Bootstrap .
Maɓallin rufewa
-
KaryewaAn sake masa suna
.close
don.btn-close
ƙaramin suna. -
Maɓallin rufewa yanzu suna amfani da
background-image
(wanda aka saka SVG) maimakon×
a cikin HTML, yana ba da damar sauƙaƙe keɓancewa ba tare da buƙatar taɓa alamarku ba. -
Ƙara sabon
.btn-close-white
bambance-bambancen da ke amfanifilter: invert(1)
da shi don ba da damar korar gumaka masu girma a kan tushen duhu.
Rushewa
- An cire gungurawa don accordions.
Zazzagewa
-
An ƙara sabon
.dropdown-menu-dark
bambance-bambancen da alaƙa masu alaƙa don buƙatu masu duhu masu duhu. -
An ƙara sabon canji don
$dropdown-padding-x
. -
Ya duhuntar da mai raba zazzage don ingantacciyar bambanci.
-
KaryewaDuk abubuwan da suka faru na zazzagewar yanzu an kunna su akan maɓallin jujjuyawar zazzage sannan a bubbled har zuwa kashi na iyaye.
-
Menu na saukarwa yanzu suna da
data-bs-popper="static"
sifa da aka saita lokacin da sanya jerin zaɓuka ya tsaya tsayin daka, ko zazzagewa yana cikin mashigin navbar. Wannan yana ƙara ta JavaScript ɗin mu kuma yana taimaka mana amfani da salon matsayi na al'ada ba tare da tsoma baki tare da sanya Popper ba. -
KaryewaZaɓin da aka
flip
sauke don plugin ɗin zaɓuka don goyon bayan daidaitawar Popper na asali. Yanzu zaku iya musaki dabi'ar jujjuyawa ta hanyar wuce tsararrun fanko donfallbackPlacements
zaɓi a cikin jujjuyawa . -
Menu na saukarwa yanzu ana iya dannawa tare da sabon
autoClose
zaɓi don sarrafa halayen kusa da auto . Kuna iya amfani da wannan zaɓin don karɓar danna ciki ko wajen menu na zazzagewa don sanya shi mu'amala. -
Dropdowns yanzu yana tallafawa
.dropdown-item
s nannade cikin<li>
s.
Jumbotron
- KaryewaAn jefar da ɓangaren jumbotron kamar yadda za'a iya kwafi shi da kayan aiki. Duba sabon misalin Jumbotron na mu don demo.
Jerin rukuni
- An ƙara sabon mai
.list-group-numbered
gyara zuwa lissafin ƙungiyoyi.
Navs da shafuka
- Ƙara sababbin
null
masu canji donfont-size
,font-weight
,color
, da:hover
color
zuwa.nav-link
aji.
Navbars
- KaryewaNavbars yanzu suna buƙatar akwati a ciki (don sauƙaƙe buƙatun tazara da buƙatar CSS).
- KaryewaBa
.active
za a iya ƙara ajin zuwa.nav-item
s ba, dole ne a yi amfani da shi kai tsaye akan.nav-link
s.
Offcanvas
- An ƙara sabon bangaren offcanvas .
Pagination
-
Hanyoyin haɗin yanar gizo a yanzu suna da abubuwan da za a iya daidaita
margin-left
su waɗanda aka zagaya da su a duk sasanninta idan aka rabu da juna. -
Ƙara
transition
s zuwa hanyoyin haɗin yanar gizo.
Popovers
-
KaryewaSake suna
.arrow
zuwa.popover-arrow
a cikin tsoho samfurin popover. -
whiteList
Zaɓin sake suna zuwaallowList
.
Masu juyawa
-
Masu jujjuyawar yanzu suna daraja
prefers-reduced-motion: reduce
ta hanyar rage raye-raye. Duba #31882 . -
Ingantattun jeri a tsaye na spinner.
Gishiri
-
Toasts yanzu za a iya sanya su a cikin wani
.toast-container
tare da taimakon saka kayan aiki . -
Canza tsoho lokacin toast zuwa 5 seconds.
-
Cire
overflow: hidden
daga toasts kuma an maye gurbinsu da daidaitattunborder-radius
s tare dacalc()
ayyuka.
Nasihun kayan aiki
-
KaryewaSake suna
.arrow
zuwa.tooltip-arrow
a cikin tsoho samfurin kayan aiki. -
KaryewaTsohuwar ƙimar don
fallbackPlacements
an canza zuwa['top', 'right', 'bottom', 'left']
don mafi kyawun wuri na abubuwan popper. -
Karyewa
whiteList
Zaɓin sake suna zuwaallowList
.
Abubuwan amfani
-
KaryewaSake suna masu amfani da yawa don amfani da sunayen kadarorin ma'ana maimakon sunayen jagora tare da ƙarin tallafin RTL:
- Sake suna
.left-*
kuma.right-*
zuwa.start-*
kuma.end-*
. - Sake suna
.float-left
kuma.float-right
zuwa.float-start
kuma.float-end
. - Sake suna
.border-left
kuma.border-right
zuwa.border-start
kuma.border-end
. - Sake suna
.rounded-left
kuma.rounded-right
zuwa.rounded-start
kuma.rounded-end
. - Sake suna
.ml-*
kuma.mr-*
zuwa.ms-*
kuma.me-*
. - Sake suna
.pl-*
kuma.pr-*
zuwa.ps-*
kuma.pe-*
. - Sake suna
.text-left
kuma.text-right
zuwa.text-start
kuma.text-end
.
- Sake suna
-
KaryewaAn kashe raƙuman mara kyau ta tsohuwa.
-
An ƙara sabon
.bg-body
aji don saurin saita<body>
bayanan zuwa ƙarin abubuwa. -
An ƙara sabbin abubuwan amfani na matsayi don
top
,right
,bottom
, daleft
. Ƙimar sun haɗa da0
,50%
, da100%
ga kowace dukiya. -
Ƙara sababbi
.translate-middle-x
&.translate-middle-y
kayan aiki zuwa a kwance ko a tsaye tsakiyar cikakkar abubuwa/kafaffen matsayi. -
An ƙara sabbin
border-width
kayan aiki . -
KaryewaAn canza suna
.text-monospace
zuwa.font-monospace
. -
KaryewaAn cire
.text-hide
shi azaman tsohuwar hanya don ɓoye rubutu wanda bai kamata a yi amfani da shi ba. -
Abubuwan da aka ƙara
.fs-*
donfont-size
abubuwan amfani (tare da kunna RFS). Waɗannan suna amfani da ma'auni ɗaya da tsoffin rubutun HTML (1-6, babba zuwa ƙarami), kuma ana iya canzawa ta taswirar Sass. -
Karyewa
.font-weight-*
Abubuwan amfani da aka sake suna.fw-*
don gajarta da daidaito. -
Karyewa
.font-style-*
Abubuwan amfani da aka sake suna.fst-*
don gajarta da daidaito. -
An ƙara
.d-grid
don nuna kayan aiki da sabbingap
kayan aiki (.gap
) don CSS Grid da shimfidar akwatin flexbox. -
KaryewaAn cire
.rounded-sm
kumarounded-lg
, kuma an gabatar da sabon sikelin azuzuwan,.rounded-0
zuwa.rounded-3
. Duba #31687 . -
Ƙara sabbin
line-height
kayan aiki:.lh-1
,.lh-sm
,.lh-base
da.lh-lg
. Duba nan . -
An matsar da
.d-none
mai amfani a cikin CSS ɗinmu don ba shi ƙarin nauyi akan sauran kayan aikin nuni. -
Ƙarfafa
.visually-hidden-focusable
mataimaki don yin aiki a kan kwantena, ta amfani da:focus-within
.
Mataimaka
-
Karyewa An sake canza mataimakan da aka saka masu amsa suna zuwa ga mataimakan rabo tare da sabbin sunaye na aji da ingantattun ɗabi'u, da kuma madaidaicin CSS mai taimako.
- An canza suna azuzuwan don canzawa
by
zuwax
yanayin yanayin. Misali,.ratio-16by9
yanzu.ratio-16x9
. - Mun jefar
.embed-responsive-item
da mai zaɓe na rukuni don neman mai zaɓe mafi sauƙi.ratio > *
. Ba a buƙatar ƙarin aji, kuma mai taimakawa rabo yanzu yana aiki tare da kowane nau'in HTML. - An
$embed-responsive-aspect-ratios
sake yiwa taswirar Sass suna$aspect-ratios
kuma an sauƙaƙa ƙimarta don haɗa sunan ajin da kashi a matsayinkey: value
biyu. - An ƙirƙira masu canjin CSS kuma an haɗa su don kowace ƙima a taswirar Sass. Gyara
--bs-aspect-ratio
m akan madaidaicin.ratio
don ƙirƙirar kowane juzu'i na al'ada .
- An canza suna azuzuwan don canzawa
-
Karyewa Azuzuwan “Mai karanta allo” yanzu azuzuwan “boye ne na gani” .
- Canza fayil ɗin Sass daga
scss/helpers/_screenreaders.scss
zuwascss/helpers/_visually-hidden.scss
- Sake suna
.sr-only
kuma.sr-only-focusable
zuwa.visually-hidden
kuma.visually-hidden-focusable
- Sake suna
sr-only()
kumasr-only-focusable()
ya haɗa zuwavisually-hidden()
davisually-hidden-focusable()
.
- Canza fayil ɗin Sass daga
-
bootstrap-utilities.css
yanzu kuma ya hada da mataimakan mu. Ba sa buƙatar shigo da mataimaka a cikin gine-gine na al'ada kuma.
JavaScript
-
An sauke jQuery dogara da sake rubuta plugins don kasancewa cikin JavaScript na yau da kullun.
-
KaryewaHalayen bayanai na duk plugins na JavaScript yanzu an raba sunaye don taimakawa bambance ayyukan Bootstrap daga ɓangare na uku da lambar ku. Misali, muna amfani da
data-bs-toggle
maimakondata-toggle
. -
Duk plugins yanzu suna iya karɓar mai zaɓin CSS azaman hujja ta farko. Kuna iya ko dai wuce wani ɓangaren DOM ko kowane mai zaɓin CSS mai aiki don ƙirƙirar sabon misalin plugin ɗin:
const modal = new bootstrap.Modal('#myModal') const dropdown = new bootstrap.Dropdown('[data-bs-toggle="dropdown"]')
-
popperConfig
za a iya wuce shi azaman aikin da ke karɓar saitunan Popper tsoho na Bootstrap a matsayin hujja, ta yadda za ku iya haɗa wannan tsohuwar saitin ta hanyar ku. Ya shafi zaɓuka, popovers, da tukwici na kayan aiki. -
Tsohuwar ƙimar don
fallbackPlacements
an canza zuwa['top', 'right', 'bottom', 'left']
don mafi kyawun wuri na abubuwan Popper. Ya shafi zaɓuka, popovers, da tukwici na kayan aiki. -
Cire ma'auni daga hanyoyin jama'a a tsaye kamar
_getInstance()
→getInstance()
.