Kutamira kune v5
Tevera uye ongorora shanduko kuBootstrap sosi mafaera, zvinyorwa, uye zvikamu zvekukubatsira kutama kubva kuv4 kuenda kuv5.
v5.2.0
Yakazorodzwa dhizaini
Bootstrap v5.2.0 inoratidzira yakavanzika dhizaini yekuvandudza kwezvishoma zvezvikamu uye zvivakwa mukati meprojekiti, zvakanyanya kuburikidza nekunatswa kwakanatswa border-radius
pamabhatani uye fomu zvidzoreso . Zvinyorwa zvedu zvakare zvakagadziridzwa nepeji nyowani yekumba, yakapfava magwaro marongero ayo asingachaputsi zvikamu zveparutivi, uye nemimwe mienzaniso yakatanhamara yeBootstrap Icons .
Mamwe maCSS akasiyana
Isu takagadziridza ese mazvikamu zvedu kuti tishandise CSS zvinosiyana. Nepo Sass ichiri kutsigira zvese, chikamu chega chega chakagadziridzwa kuti chisanganise CSS zvinosiyana pachikamu chechikamu makirasi (eg, .btn
), zvichibvumira imwe chaiyo-nguva kugadzirisa yeBootstrap. Mukuburitswa kunotevera, isu ticharamba tichiwedzera mashandisiro edu eCSS akasiyana muchimiro chedu, mafomu, vabatsiri, uye zvekushandisa. Verenga zvakawanda nezve CSS zvinosiyana muchikamu chimwe nechimwe pamapeji avo ezvinyorwa.
Kushandiswa kwedu kweCSS kunenge kusina kukwana kusvika Bootstrap 6. Kunyange tichida kushandisa zvizere izvi kumativi ose, zvinotungamirira njodzi yekukonzera kuchinja. Semuyenzaniso, kuseta $alert-border-width: var(--bs-border-width)
mune yedu sosi kodhi inopwanya ingangoita Sass mune yako kodhi kana wanga uchiita $alert-border-width * 2
nekuda kwechimwe chikonzero.
Saka nekudaro, pese pazvinogoneka, ticharamba tichisundidzira kune mamwe maCSS akasiyana, asi ndapota ziva kuti kuita kwedu kunogona kuve kushoma muv5.
New_maps.scss
Bootstrap v5.2.0 yakaunza faira idzva reSass rine _maps.scss
. Inoburitsa mamepu akati wandei eSass kubva _variables.scss
kugadzirisa nyaya uko zvigadziriso kumepu yepakutanga hazvina kuiswa kune yechipiri mepu dzinodziwedzera. Semuenzaniso, zvigadziriso $theme-colors
zvanga zvisiri kushandiswa kune mamwe mamepu emusoro aivimba nawo $theme-colors
, kutyora kiyi yekugadzirisa mafambiro. Muchidimbu, Sass ine muganho apo kana mepu yakamboshandiswa kana mepu , haigone kuvandudzwa. Pane kuperevedza kwakafanana neCSS zvinosiyana kana zvichishandiswa kugadzira mamwe maCSS akasiyana.
Ichi ndicho chikonzero magadzirirwo akasiyana muBootstrap anofanirwa kuuya mushure @import "functions"
, asi zvisati zvaitika @import "variables"
uye zvimwe zvese zvekutumira. Zvimwe chetezvo zvinoshanda kumamepu eSass-iwe unofanirwa kudarika izvo zvisiri izvo zvisati zvashandiswa. Mamepu anotevera akaendeswa kune itsva _maps.scss
:
$theme-colors-rgb
$utilities-colors
$utilities-text
$utilities-text-colors
$utilities-bg
$utilities-bg-colors
$negative-spacers
$gutters
Yako tsika yeBootstrap CSS inovaka inofanira ikozvino kutaridzika seizvi ine yakaparadzana mepu kupinza.
// 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
Zvishandiso zvitsva
font-weight
Zvishandiso zvakawedzerwa zvinosanganisira semibold.fw-semibold
mafonti.- Zvishandiso
border-radius
zvakawedzerwa zvinosanganisira maviri matsva saizi,.rounded-4
uye.rounded-5
, kune dzimwe sarudzo.
Dzimwe shanduko
-
Yakasuma
$enable-container-classes
sarudzo itsva. - Zvino paunopinda muyedzo yeCSS Grid dhizaini,.container-*
makirasi acharamba achiunganidzwa, kunze kwekunge iyi sarudzo yaiswafalse
. Makoniti zvakare zvino anochengeta hunhu hwawo hwegutter. -
Offcanvas chikamu ikozvino chine mhinduro dzakasiyana . Kirasi yekutanga
.offcanvas
inoramba isina kuchinjika-inovanza zvemukati pane ese maratidziro. Kuita kuti ipindure, shandura iyo.offcanvas
kirasi kune chero.offcanvas-{sm|md|lg|xl|xxl}
kirasi. -
Zvikamu zvakakora zvetafura zvino vasarudza kupinda. — Tabvisa iyo yakakora uye yakanyanya kuoma kudarika muganhu pakati pemapoka ematafura uye takaiendesa kune imwe kirasi yaungasarudza iwe yaunogona kunyorera,
.table-group-divider
. Ona tafura docs semuenzaniso. -
Scrollspy yakanyorwazve kuti ishandise Intersection Observer API , zvinoreva kuti hauchada hama dzevabereki wrappers, deprecates
offset
config, nezvimwe. Tarisa mashandisirwo ako eScrollspy kuti ave akanyanya uye anoenderana mukusimbisa kwavo nav. -
Popovers uye tooltips ikozvino shandisa CSS zvinosiyana. Zvimwe zvakasiyana-siyana zveCSS zvakagadziridzwa kubva kune avo veSass kuti vaderedze huwandu hwemhando. Nekuda kweizvozvo, matatu akasiyana akaregwa mukuburitswa uku:
$popover-arrow-color
,$popover-arrow-outer-color
, uye$tooltip-arrow-color
. -
Akawedzera
.text-bg-{color}
vabatsiri vatsva. Panzvimbo yekuseta munhu.text-*
uye.bg-*
zvekushandisa, iwe zvino unogona kushandisa vabatsiri.text-bg-*
kuseta inebackground-color
inosiyanisa kumbericolor
. -
Yakawedzera
.form-check-reverse
gadziriso kuti ishandure kurongeka kwemavara uye anosanganisirwa mabhokisi ekutarisa/redhiyo. -
Yakawedzera mitsetse makoramu rutsigiro kumatafura kuburikidza
.table-striped-columns
nekirasi itsva.
Kuti uwane runyoro rwakakwana rwekuchinja, ona v5.2.0 chirongwa paGitHub .
v5.1.0
-
Yakawedzera tsigiro yekuedza yeCSS Grid marongero . - Iri ibasa ririkuenderera mberi, uye harisati ragadzirira kushandiswa kwekugadzira, asi unogona kupinda muchinhu chitsva kuburikidza neSass. Kuti uigonese, dzima iyo yakasarudzika grid, nekuisa
$enable-grid-classes: false
uye kugonesa iyo CSS Grid nekuisa$enable-cssgrid: true
. -
Yakagadziridzwa ma navbar kuti itsigire offcanvas. - Wedzera offcanvas madhirowa mune chero navbar nemakirasi anoteerera
.navbar-expand-*
uye mamwe offcanvas markup. -
Yakawedzera chikamu chitsva chechibatiso . -Chidimbu chedu chitsva, nzira yekupa zvidhinha zvenguva pfupi pachinzvimbo chezvinyorwa chaizvo kubatsira kuratidza kuti chimwe chinhu chichiri kurodha musaiti yako kana app.
-
Collapse plugin ikozvino inotsigira yakachinjika kudonha . - Wedzera
.collapse-horizontal
kune yako.collapse
kudonha iyowidth
pachinzvimbo cheiyoheight
. Dzivisa kupendazve bhurawuza nekuisamin-height
kanaheight
. -
Yakawedzera stack itsva uye vertical rule vabatsiri. -Kurumidza shandisa akawanda flexbox zvivakwa kuti akurumidze kugadzira zvimiro zvetsika nemastacks . Sarudza kubva kune yakachinjika (
.hstack
) uye yakatwasuka (.vstack
) stacks. Wedzera vertical dividers yakafanana<hr>
nezvinhu zvine vabatsiri vatsva.vr
. -
Yakawedzera mitsva yepasi rose
:root
yeCSS. - Yakawedzera akati wandei matsva eCSS akasiyana:root
padanho rekudzora<body>
masitaera. Zvakawanda zviri mumabasa, kusanganisira pazvishandiso zvedu zvese uye zvikamu, asi parizvino verenga zvinosiyana zveCSS muchikamu cheGadzirisa . -
Yakakwenenzverwa ruvara uye kumashure zvinoshandiswa kushandisa CSS zvinosiyana, uye yakawedzera zvinyorwa zvitsva opacity uye kumashure opacity utilities. -
.text-*
uye.bg-*
zvishandiso zvave kuvakwa neCSS zvinosiyana uyergba()
mavara emhando, zvichikutendera iwe kuti ugadzirise zviri nyore chero zvishandiso nezvitsva zve opacity utilities. -
Yakawedzera snippet mienzaniso mitsva yakavakirwa kuratidza maitiro ekugadziridza zvikamu zvedu. - Dhonza wakagadzirira kushandisa zvakagadziridzwa zvikamu uye mamwe akajairwa dhizaini mapatani nemienzaniso yedu mitsva yeSnippets . Inosanganisira ma footer , dropdowns , list groups , uye modal .
-
Yakabviswa masitaera asina kushandiswa kubva kumapopovers uye matipi ezvishandiso sezvo aya achibatwa chete naPopper.
$tooltip-margin
yakadzimwa uye yakaiswanull
mukuita.
Unoda rumwe ruzivo here? Verenga iyo v5.1.0 blog post.
Dependencies
- Yakadonha jQuery.
- Yakakwidziridzwa kubva kuPopper v1.x kuenda kuPopper v2.x.
- Yakatsiviwa Libsass neDart Sass seyedu Sass compiler yakapihwa Libsass yakabviswa.
- Takatama kubva kuJekyll kuenda kuHugo kuti tivake zvinyorwa zvedu
Browser rutsigiro
- Yakadonhedza Internet Explorer 10 uye 11
- Yakadonhedza Microsoft Edge <16 (Legacy Edge)
- Yakadonha Firefox <60
- Yakadonhedza Safari <12
- Yakadonhedza iOS Safari <12
- Yakadonhedza Chrome <60
Zvinyorwa zvinoshanduka
- Yakagadziridzwa patsva peji remba, docs marongero, uye tsoka.
- Yakawedzera Parcel gwara idzva .
- Yakawedzera chikamu chitsva cheGadzirisa , ichitsiva v4's Theming peji , neruzivo rutsva paSass, sarudzo dzepasirese dzekugadzirisa, zvirongwa zvemavara, CSS zvinosiyana, nezvimwe.
- Akarongazve zvinyorwa zvese zvemafomu kuita chikamu chitsva cheMafomu , achipatsanura zvirimo kuita mapeji akanyanya kutariswa.
- Saizvozvo, yakagadziridza iyo Layout chikamu , kuti ibudise grid zvirimo zvakajeka.
- Yakatumidzwazve "Navs" chikamu peji ku "Navs & Tabs".
- Yakapihwa zita rekuti "Cheki" peji kuti "Macheki & maredhiyo".
- Yakagadziridzazve bhara uye nekuwedzera subnav itsva kuti zvive nyore kutenderera nesaiti yedu uye zvinyorwa zvinyorwa.
- Yakawedzera nzira yekudimbudzira yekhibhodi yenzvimbo yekutsvaga: Ctrl + /.
Sass
-
Takasiya mepu yeSass yakabatana kuti zvive nyore kubvisa hunhu husina basa. Ramba uchifunga iwe zvino unofanirwa kutsanangura kukosha kwese mumamepu eSass senge
$theme-colors
. Tarisa uone maitiro ekuita neSass mepu . -
KupwanyaYakatumidzwa zita
color-yiq()
uye zvine hukama zvinosiyanacolor-contrast()
sezvo zvisisane hukama neYIQ nzvimbo yemavara. Ona #30168.$yiq-contrasted-threshold
inotumidzwa zita rokuti$min-contrast-ratio
.$yiq-text-dark
uye$yiq-text-light
vanopihwa zita rekuti$color-contrast-dark
uye$color-contrast-light
.
-
KupwanyaMedia query mixins parameters zvachinja kune imwe nzira inonzwisisika.
media-breakpoint-down()
inoshandisa iyo breakpoint pachayo pachinzvimbo cheinotevera breakpoint (semuenzaniso,media-breakpoint-down(lg)
pachinzvimbomedia-breakpoint-down(md)
chetariro yekuona madiki panelg
).- Saizvozvo, yechipiri paramende mukati
media-breakpoint-between()
inoshandisawo breakpoint pachayo pachinzvimbo cheinotevera breakpoint (semuenzaniso,media-between(sm, lg)
pachinzvimbomedia-breakpoint-between(sm, md)
chezvinangwa zvekutarisa pakatism
nelg
).
-
KupwanyaYakabviswa zvitaera zvekudhinda uye
$enable-print-styles
zvakasiyana. Dhinda makirasi ekuratidzira achiripo. Ona #28339 . -
KupwanyaYakadonhedzwa
color()
,theme-color()
, uyegray()
inoshanda mukufarira zvinosiyana. Ona #29083 . -
KupwanyaRenamed
theme-color-level()
basa kunecolor-level()
uye ikozvino rinogamuchira chero ruvara rwaunoda pachinzvimbo$theme-color
chemavara chete. Ona #29083 Chenjerera:color-level()
yakazodonhedzwa gare garev5.0.0-alpha3
. -
KupwanyaYakapihwa zita
$enable-prefers-reduced-motion-media-query
uye$enable-pointer-cursor-for-buttons
ku$enable-reduced-motion
uye$enable-button-pointers
nekupfupika. -
KupwanyaYakabviswa
bg-gradient-variant()
mixin. Shandisa.bg-gradient
kirasi kuwedzera gradients kune zvinhu panzvimbo.bg-gradient-*
yemakirasi akagadzirwa. -
Kupwanya Yakabviswa yakasanganiswa yakamborambwa:
hover
,,, uyehover-focus
_plain-hover-focus
hover-focus-active
float()
form-control-mixin()
nav-divider()
retina-img()
text-hide()
(yakadonhedzawo kirasi yakabatana yekushandisa,.text-hide
)visibility()
form-control-focus()
-
KupwanyaYakatumidzwa zita rekuti
scale-color()
kudzivirirashift-color()
kudhumhana neSass's own color scaling function. -
box-shadow
mixins ikozvino inobvumiranull
kukosha uye kudonhanone
kubva kune dzakawanda nharo. Ona #30394 . -
Iyo
border-radius()
mixin ikozvino ine default kukosha.
Rudzi system
-
Iyo color system iyo yakashanda nayo
color-level()
uye$theme-color-interval
yakabviswa ichifarira imwe color system. Zveselighten()
uyedarken()
mabasa mucodebase yedu anotsiviwatint-color()
neshade-color()
. Aya mabasa achasanganisa ruvara nechero chena kana dema pane kushandura kureruka kwaro nehuwandu hwakatarwa. Iyoshift-color()
inopenya kana mumvuri weruvara zvichienderana nekuti huremu hwayo paramende yakanaka here kana yakaipa. Ona #30622 kuti uwane rumwe ruzivo. -
Yakawedzera matinji matsva uye mimvuri yeruvara rwese, ichipa mapfumbamwe akaparadzana mavara ega ega ega color, seatsva Sass akasiyana.
-
Kuvandudzwa kwemavara akasiyana. Bumped color difference ratio kubva pa3:1 kusvika 4.5:1 uye yakagadziridzwa bhuruu, girinhi, cyan, uye pink mavara kuona WCAG 2.1 AA musiyano. Yakashandurawo ruvara rweruvara rwedu kubva
$gray-900
ku$black
. -
Kuti titsigire hurongwa hweruvara rwedu, tawedzera tsika itsva
tint-color()
uyeshade-color()
mabasa kusanganisa mavara edu nenzira kwayo.
Grid updates
-
New breakpoint! Yakawedzera
xxl
breakpoint nyowani1400px
yekukwira nekukwira. Hapana shanduko kune mamwe mabreakpoints ese. -
Gutters dzakavandudzwa. Gutters ikozvino yakaiswa murems, uye idiki pane v4 (
1.5rem
, kana nezve24px
, pasi kubva30px
). Izvi zvinowiriranisa magita edu egridi system nemaitiro edu ekuisa nzvimbo.- Yakawedzera kirasi itsva yeguta (
.g-*
,.gx-*
, uye.gy-*
) kudzora magita akachinjika/akatwasuka, magita akachinjika, uye magita akatwasuka. - KupwanyaYakapihwa zita
.no-gutters
kuti.g-0
ienderane nezvitsva zvegutter.
- Yakawedzera kirasi itsva yeguta (
-
Makolamu haachashandisi
position: relative
, saka unogona kuwedzera.position-relative
kune zvimwe zvinhu kudzoreredza maitiro iwayo. -
KupwanyaAkasiya makirasi akati wandei
.order-*
aiwanzoenda asina kushandiswa. Isu zvino tinongopa.order-1
kunze.order-5
kwebhokisi. -
KupwanyaYakadonhedza
.media
chikamu nekuti chinogona kudzokororwa zviri nyore nezvishandiso. Ona #28265 uye peji rezvishandiso semuenzaniso . -
Kupwanya
bootstrap-grid.css
ikozvino inongoshandabox-sizing: border-box
kune iyo column pachinzvimbo chekugadzirisa bhokisi-saizi yepasi rose. Nenzira iyi, yedu grid masitaera anogona kushandiswa munzvimbo dzakawanda pasina kukanganisa. -
$enable-grid-classes
haichadzimi kugadzirwa kwemakirasi emidziyo zvakare. Ona #29146. -
Yakagadziridza mixin
make-col
kuti ive yakasarudzika kusvika kumakoramu akaenzana pasina saizi yakatarwa.
Zvemukati, Reboot, nezvimwe
-
RFS ikozvino inogoneswa nekusarudzika. Misoro inoshandisa
font-size()
mixin inongogadzirisa yavofont-size
kuti iwedzere nekutarisa. Iyi ficha yaimbopinda nev4. -
KupwanyaYakagadziridza typography yedu yekuratidzira kuti itsive
$display-*
madhiri uye$display-font-sizes
nemepu yeSass. Akabvisawo zvimiro zvega zvega zvega$display-*-weight
uye$display-font-weight
zvakagadziriswafont-size
s. -
Yakawedzera saizi mbiri nyowani
.display-*
dzemusoro,.display-5
uye.display-6
. -
Manongedzo anotsikirirwa nekusarudzika (kwete chete pane hover), kunze kwekunge ari chikamu chezvakananga zvikamu.
-
Akagadziridzwazve matafura kuti avandudze masitayera avo uye nekuvavaka patsva neCSS mavhezheni kuti awedzere kutonga pamusoro pemaitiro.
-
KupwanyaNested tables haachagari nhaka yezvitaera zvakare.
-
Kupwanya
.thead-light
uye.thead-dark
anodonhedzwa achifarira.table-*
makirasi akasiyana anogona kushandiswa kune ese matafura zvinhu ( ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,thead
)tbody
) ) ) _tfoot
tr
th
td
-
KupwanyaIyo
table-row-variant()
mixin inotumidzwa zitatable-variant()
uye inogamuchira chete 2 paramita:$color
(zita reruvara) uye$value
(ruvara kodhi). Rudzi rwemuganhu uye accent mavara anoverengerwa otomatiki zvichienderana netafura factor variables. -
Split table cell padding variables kupinda
-y
uye-x
. -
Kupwanya
.pre-scrollable
Kirasi yakadonha . Ona #29135 -
Kupwanya
.text-*
zvishandiso hazviwedzere hover uye inotarisisa nyika kune zvinongedzo zvakare..link-*
makirasi emubatsiri anogona kushandiswa panzvimbo. Ona #29267 -
Kupwanya
.text-justify
Kirasi yakadonha . Ona #29793 -
Kupwanya
<hr>
zvinhu zvino shandisaheight
pachinzvimboborder
chekutsigira zvirinanisize
hunhu. Izvi zvakare zvinogonesa kushandiswa kwezvishandiso zvepadhi kuti zvigadzire zvakakora zvigovani (semuenzaniso,<hr class="py-1">
). -
Reset default horizontal
padding-left
on<ul>
uye<ol>
zvinhu kubva kubrowser default40px
kusvika2rem
. -
Yakawedzerwa
$enable-smooth-scroll
, iyo inoshandascroll-behavior: smooth
pasi rose-kunze kwevashandisi vanokumbira kuderedzwa kufamba kuburikidzaprefers-reduced-motion
nemubvunzo wenhau. Ona #31877
RTL
- Horizontal direction chakanangana nekusiyana, zvishandiso, uye musanganiswa zvese zvakapihwa zita kuti zvishandise zvine musoro zvivakwa sezvinowanikwa muflexbox marongero-semuenzaniso,
start
uyeend
pachinzvimbo cheleft
uyeright
.
Mafomu
-
Akawedzera mafomu matsva anoyangarara! Isu takasimudzira iwo Floating labels muenzaniso kune anonyatso tsigira fomu zvikamu. Wona peji remavara anoyangarara.
-
Kupwanya Consolidated native uye tsika chimiro zvinhu. Mabhokisi ekutarisa, maredhiyo, anosarudza, uye mamwe mapindiro anga aine makirasi echinyakare uye etsika muv4 akabatanidzwa. Iye zvino zvinenge zvese zvemafomu edu zvakazara tsika, mazhinji pasina kudiwa kwetsika HTML.
.custom-control.custom-checkbox
ikozvino.form-check
..custom-control.custom-custom-radio
ikozvino.form-check
..custom-control.custom-switch
ikozvino.form-check.form-switch
..custom-select
ikozvino.form-select
..custom-file
uye.form-file
akatsiviwa nemaitiro echivanhu pamusoro pe.form-control
..custom-range
ikozvino.form-range
.- Akadonhedza chizvarwa
.form-control-file
uye.form-control-range
.
-
KupwanyaYakadonha
.input-group-append
uye.input-group-prepend
. Iwe zvino unogona kungowedzera mabhatani uye.input-group-text
sevana vakananga vemapoka ekuisa. -
Iyo yakareba Yakashaikwa yemubhodha radius paboka rekuisa nerutsigiro rwemhinduro tsikidzi inozogadziriswa nekuwedzera imwe
.has-validation
kirasi kumapoka ekuisa ane vimbiso. -
Kupwanya Yakadonhedza fomu-chaiyo dhizaini makirasi kune yedu grid system. Shandisa grid uye zvishandiso pane
.form-group
,.form-row
, kana.form-inline
. -
KupwanyaMazita efomu zvino anoda
.form-label
. -
Kupwanya
.form-text
no longer setsdisplay
, zvichikubvumidza kuti ugadzire inline kana kuvharira mameseji ekubatsira sezvaunoda nekungochinja chinhu cheHTML. -
Mafomu ekudzora haachashandiswi akagadziriswa
height
pazvinogoneka, pachinzvimbo chekuverengeramin-height
kuvandudza kugadzirisa uye kuenderana nezvimwe zvikamu. -
Validation icons haichashandiswi kune
<select>
s inemultiple
. -
Rearranged source Sass mafaera ari pasi pe
scss/forms/
, kusanganisira zvitaera zveboka rekupinda.
Zvikamu
- Hunhu hwakabatana hwekuzivisa, zvimedu zvechingwa, makadhi, kudonhedza, rondedzero mapoka, modals, popovers
padding
, uye matipi ezvishandiso zvinoenderana$spacer
nekusiyana kwedu. Ona #30564 .
Accordion
- Yakawedzera chikamu chitsva cheaccordion .
Alerts
-
Yambiro ikozvino ine mienzaniso ine zvidhori .
-
Yakabviswa masitaira echivanhu e
<hr>
s mune yambiro yega yega sezvo vachitoshandisacurrentColor
.
Mabheji
-
KupwanyaYakadonhedza ese
.badge-*
makirasi emavara ezvishandiso zvemashure (semuenzaniso, shandisa.bg-primary
pachinzvimbo che.badge-primary
). -
KupwanyaYakadonhedzwa
.badge-pill
- shandisa.rounded-pill
zvinoshandiswa panzvimbo. -
KupwanyaYakabviswa hover uye yekutarisa masitaera
<a>
uye<button>
zvinhu. -
Yakawedzera default padding yemabheji kubva
.25em
/.5em
kuenda.35em
/.65em
.
Zvimedu zvechingwa
-
Yakarerutsa kutaridzika kwechingwa chechingwa nekubvisa
padding
,background-color
, uyeborder-radius
. -
Yakawedzera itsva CSS tsika chivakwa
--bs-breadcrumb-divider
kuti zvive nyore kugadzirisa pasina kuda kudzoreredza CSS.
Mabhatani
-
Kupwanya Shandura mabhatani , ane mabhokisi ekutarisa kana maredhiyo, haachadi JavaScript uye ave nemarkup itsva. Isu hatichada chekuputira chinhu, wedzera
.btn-check
kune iyo<input>
, uye batanidza nechero.btn
makirasi pa<label>
. Ona #30650 . Zvinyorwa zveizvi zvatama kubva peji redu reMabhatani kuenda kuchikamu chitsva cheMafomu. -
Kupwanya Yakadonhedzwa
.btn-block
kuitira zvishandiso. Panzvimbo pekushandisa.btn-block
pane iyo.btn
, peta mabhatani ako.d-grid
nekushandisa.gap-*
kuaisa panzvimbo sezvinodiwa. Chinja kumakirasi anopindura kuti uwedzere kutonga pamusoro pawo. Verenga zvinyorwa zvemimwe mienzaniso. -
Yakagadziridzwa yedu
button-variant()
uyebutton-outline-variant()
musanganiswa kutsigira mamwe ma paramita. -
Akagadziridzwa mabhatani kuti ave nechokwadi chekuwedzera kusiyanisa pane hover uye inoshanda nyika.
-
Mabhatani akaremara ava ne
pointer-events: none;
.
Card
-
KupwanyaYakadonha
.card-deck
mukufarira grid yedu. Putira makadhi ako mumakirasi ekoramu uye wedzera mudziyo wemubereki.row-cols-*
kuti udzore makadhi emakadhi (asi nekutonga kwakawanda pamusoro pekuenderana kunoteerera). -
KupwanyaAkadonha
.card-columns
achifarira Masonry. Ona #28922 . -
KupwanyaYakatsiva iyo
.card
yakavakirwa accordion nechinhu chitsva cheAccordion .
Carousel
-
Yakawedzera
.carousel-dark
musiyano mutsva wemavara akasviba, zvinodzora, uye zviratidzi (yakanaka kune yakareruka kumashure). -
Yakatsiviwa chevron icons ye carousel control ine maSVG matsva kubva kuBootstrap Icons .
Vhara bhatani
-
KupwanyaYakapihwa
.close
zita.btn-close
rezita risingaite. -
Vhara mabhatani ikozvino shandisa
background-image
(yakamisikidzwa SVG) pachinzvimbo×
cheiyo muHTML, ichibvumira kuti zvive nyore kugadzirisa pasina chikonzero chekubata markup yako. -
Yakawedzera
.btn-close-white
mutsauko mutsva unoshandisafilter: invert(1)
kugonesa misiyano yepamusoro yekudzinga ma icons kubva kune yakasviba kumashure.
Collapse
- Yakabviswa scroll anchoring yema accordions.
Dropdowns
-
Yakawedzera
.dropdown-menu-dark
mutsauko mutsva uye anosanganisirwa akasiyana epa-inoda rima kudonhedza. -
Yakawedzerwa shanduko itsva ye
$dropdown-padding-x
. -
Yakasvibira chinodonhedza chinodonhedza kuitira kusiyana kwakavandudzwa.
-
KupwanyaZvese zviitiko zvekudonhedza zvave kukonzereswa pane yekudonhedza toggle bhatani uyezve bhatani kumusoro kune chinhu chemubereki.
-
Mamenu ekudonhedza zvino ane
data-bs-popper="static"
hunhu hwakaiswa kana nzvimbo yekudonha yakamira, kana kudonha kuri mubhara. Izvi zvinowedzerwa neJavaScript yedu uye zvinotibatsira kushandisa masitaera echinyakare tisingakanganise nzvimbo yaPopper. -
KupwanyaYakadonhedza
flip
sarudzo yekudonhedza plugin mukufarira yemuno Popper kumisikidzwa. Iwe zvino unogona kudzima maitiro ekubhururuka nekupfuura isina chinhu array yesarudzo muflipfallbackPlacements
modifier . -
Mamenu ekudonhedza zvino anogona kubatika
autoClose
nesarudzo nyowani yekubata maitiro ekuvhara otomatiki . Unogona kushandisa iyi sarudzo kugamuchira kudzvanya mukati kana kunze kwemenu yekudonha kuti iite kudyidzana. -
Dropdowns ikozvino inotsigira
.dropdown-item
yakaputirwa<li>
mus.
Jumbotron
- KupwanyaYakadonhedza chikamu chejumbotron sezvo ichikwanisa kudzokororwa nezvishandiso. Ona yedu itsva Jumbotron muenzaniso wedemo.
Rondedzera boka
- Yakawedzera gadziriso nyowani
.list-group-numbered
kumapoka mapoka.
Navs uye tabs
- Akawedzera mavara matsva
null
efont-size
,font-weight
,color
, uye:hover
color
kukirasi.nav-link
.
Navbars
- KupwanyaNavbars ikozvino inoda mudziyo mukati (kurerutsa zvakanyanya kudiwa kwenzvimbo uye CSS inodiwa).
- KupwanyaKirasi
.active
haichagoni kushandiswa kune.nav-item
s, inofanira kushandiswa zvakananga pa.nav-link
s.
Offcanvas
- Yakawedzera chinhu chitsva cheoffcanvas .
Pagination
-
Pagination links ikozvino ine customizable
margin-left
iyo inotenderedzwa zvine simba pamakona ese kana yakaparadzaniswa kubva kune imwe. -
Yakawedzerwa
transition
s kune pagination link.
Popover
-
KupwanyaYakatumidzwa zita
.arrow
mune.popover-arrow
yedu default popover template. -
Yakapihwa zita
whiteList
sarudzo kuallowList
.
Spinners
-
Spinners zvino vanokudza
prefers-reduced-motion: reduce
nekudzikisira animations. Ona #31882 . -
Yakavandudzwa spinner vertical alignment.
Toasts
-
Toasts ikozvino inogona kuiswa mu a
.toast-container
nerubatsiro rwekuisa zvishandiswa . -
Yakachinja nguva yetoast yagara iripo kuita masekonzi mashanu.
-
Yakabviswa
overflow: hidden
kubva kune toast uye yakatsiviwa neyakakodzeraborder-radius
s inecalc()
mabasa.
Tooltips
-
KupwanyaYakapihwa zita
.arrow
mune.tooltip-arrow
yedu default tooltip template. -
KupwanyaIko kukosha kwakasarudzika kweiyo inochinjirwa
fallbackPlacements
kune['top', 'right', 'bottom', 'left']
yekuiswa zvirinani kwezvinhu zvepopper. -
KupwanyaYakapihwa zita
whiteList
sarudzo kuallowList
.
Utilities
-
KupwanyaAkatumidza zita rekushandisa zvakati wandei kuti ushandise zvine musoro mazita ezvivakwa panzvimbo yemazita ekutungamira nekuwedzera kweRTL rutsigiro:
- Renamed
.left-*
uye.right-*
ku.start-*
uye.end-*
. - Renamed
.float-left
uye.float-right
ku.float-start
uye.float-end
. - Renamed
.border-left
uye.border-right
ku.border-start
uye.border-end
. - Renamed
.rounded-left
uye.rounded-right
ku.rounded-start
uye.rounded-end
. - Renamed
.ml-*
uye.mr-*
ku.ms-*
uye.me-*
. - Renamed
.pl-*
uye.pr-*
ku.ps-*
uye.pe-*
. - Renamed
.text-left
uye.text-right
ku.text-start
uye.text-end
.
- Renamed
-
KupwanyaYakaremara miganho isina kunaka nekukasira.
-
Yakawedzera
.bg-body
kirasi nyowani yekukurumidza kuseta iyo<body>
kumashure kune zvimwe zvinhu. -
Yakawedzera zvinzvimbo zvitsva zve
top
,right
,bottom
, uyeleft
. Mitemo inosanganisira0
,50%
, uye100%
yechinhu chimwe nechimwe. -
Yakawedzera zvitsva
.translate-middle-x
&.translate-middle-y
zvinoshandiswa kune yakachinjika kana yakatwasuka pakati pemhedziso / yakamisikidzwa yakamisikidzwa zvinhu. -
Yakawedzera
border-width
zvishandiso zvitsva . -
KupwanyaYakapihwa zita
.text-monospace
rekuti.font-monospace
. -
KupwanyaYakabviswa
.text-hide
sezvo iri nzira yechinyakare yekuviga zvinyorwa zvisingachafanirwe kushandiswa zvakare. -
Yakawedzerwa
.fs-*
zvishandisofont-size
zvezvishandiso (ine RFS inogoneswa). Aya anoshandisa chikero chakafanana neHTML's default headings (1-6, hombe kusvika kudiki), uye inogona kugadziridzwa kuburikidza neSass mepu. -
KupwanyaYakapihwa zita
.font-weight-*
rekushandisa.fw-*
sekupfupika uye kuenderana. -
KupwanyaYakapihwa zita
.font-style-*
rekushandisa.fst-*
sekupfupika uye kuenderana. -
Yakawedzerwa
.d-grid
kuratidza zvishandiso uye zvitsvagap
zvinoshandiswa (.gap
) zveCSS Grid uye flexbox marongero. -
KupwanyaYakabviswa
.rounded-sm
uyerounded-lg
, uye yakaunza chiyero chitsva chekirasi,.rounded-0
ku.rounded-3
. Ona #31687 . -
Yakawedzera
line-height
zvishandiso zvitsva:.lh-1
,.lh-sm
,.lh-base
uye.lh-lg
. Ona pano . -
Yakafambisa iyo
.d-none
yekushandisa muCSS yedu kuti iwedzere huremu pamusoro pezvimwe zviratidziro zvekushandisa. -
Akawedzera
.visually-hidden-focusable
mubatsiri kuti ashandewo pamidziyo, achishandisa:focus-within
.
Vabatsiri
-
Kupwanya Vanoteerera embed vabatsiri vakatumidzwa zita rekuti vabatsiri vane mazita ekirasi matsva uye maitiro akavandudzwa, pamwe chete nerubatsiro rweCSS kusiyanisa.
- Makirasi akatumidzwa zita kuti achinje
by
kunex
chikamu chechikamu. Somuenzaniso,.ratio-16by9
zvino.ratio-16x9
. - Tadonhedza iyo
.embed-responsive-item
uye element group yekusarudzi tichida imwe iri nyore.ratio > *
yekusarudza. Hapasisina kirasi inodiwa, uye reshiyo mubatsiri ikozvino inoshanda nechero HTML chinhu. - Mepu
$embed-responsive-aspect-ratios
yeSass yakatumidzwa zita$aspect-ratios
uye hunhu hwayo hwakarerutswa kuti ubatanidze zita rekirasi uye muzanakey: value
sevaviri. - CSS zvinosiyana zvave kugadzirwa uye zvinosanganisirwa kune yega yega kukosha muSass mepu. Shandura
--bs-aspect-ratio
shanduko pairi.ratio
kuti ugadzire chero chimiro chetsika .
- Makirasi akatumidzwa zita kuti achinje
-
Kupwanya "Screen reader" makirasi ave "akavanzika zvinoonekwa" makirasi .
- Yakachinja faira reSass kubva
scss/helpers/_screenreaders.scss
kuendascss/helpers/_visually-hidden.scss
- Yakatumidzwa
.sr-only
uye.sr-only-focusable
ku.visually-hidden
uye.visually-hidden-focusable
- Yakatumidzwa
sr-only()
uyesr-only-focusable()
inosanganiswa kuvisually-hidden()
uyevisually-hidden-focusable()
.
- Yakachinja faira reSass kubva
-
bootstrap-utilities.css
zvino kusanganisirawo vabatsiri vedu. Vabatsiri havachadi kutengwa kunze kwenyika mune zvetsika zvinovaka zvakare.
JavaScript
-
Yakadonhedza jQuery kutsamira uye kunyorazve plugins kuti ive yenguva dzose JavaScript.
-
KupwanyaMamiriro e data kune ese maJavaScript plugins ave akaiswa mazita kuti abatsire kusiyanisa mashandiro eBootstrap kubva kumapato echitatu uye yako kodhi. Somuenzaniso, tinoshandisa
data-bs-toggle
panedata-toggle
. -
Ese maplugins anogona ikozvino kugamuchira CSS selector senharo yekutanga. Unogona kupfuudza chinhu cheDOM kana chero cheCSS chakasarudzika kuti ugadzire chiitiko chitsva cheplugin:
const modal = new bootstrap.Modal('#myModal') const dropdown = new bootstrap.Dropdown('[data-bs-toggle="dropdown"]')
-
popperConfig
inogona kupfuudzwa sebasa rinogamuchira iyo Bootstrap's default Popper config senharo, kuitira kuti iwe ugone kubatanidza iyi yekumisikidza yekumisikidza munzira yako. Inoshanda kune kudonhedza, popovers, uye matipi ekushandisa. -
Iko kukosha kwakasarudzika kweiyo inochinjirwa
fallbackPlacements
kune['top', 'right', 'bottom', 'left']
yekuiswa nani kwePopper zvinhu. Inoshanda kune kudonhedza, popovers, uye matipi ekushandisa. -
Yakabviswa underscore kubva kune yeruzhinji static nzira senge
_getInstance()
→getInstance()
.