Hloov mus rau v4
Bootstrap 4 yog qhov rov sau dua tshiab ntawm tag nrho qhov project. Cov kev hloov pauv tseem ceeb tshaj plaws tau sau tseg hauv qab no, ua raws li kev hloov pauv tshwj xeeb rau cov khoom muaj feem cuam tshuam.
Kev hloov ruaj khov
Tsiv ntawm Beta 3 mus rau peb qhov ruaj khov v4.x tso tawm, tsis muaj kev hloov pauv, tab sis muaj qee qhov kev hloov pauv tseem ceeb.
Kev luam ntawv
-
Txhim kho cov khoom siv hluav taws xob tawg. Yav dhau los, kev siv
.d-print-*
chav kawm yuav npaj txhij txog overrule lwm.d-*
chav kawm. Tam sim no, lawv phim peb lwm cov khoom siv tso saib thiab tsuas yog siv rau cov xov xwm ntawd (@media print
). -
Nthuav cov khoom siv luam ntawv nthuav dav kom phim rau lwm yam khoom siv. Beta 3 thiab laus dua tsuas muaj
block
,inline-block
,inline
, thiabnone
. Stable v4 ntxivflex
,inline-flex
,table
,table-row
, thiabtable-cell
. -
Tsau luam tawm saib ua ntej rendering hla browsers nrog cov qauv luam tawm tshiab uas qhia meej
@page
size
.
Beta 3 hloov pauv
Thaum Beta 2 pom feem ntau ntawm peb cov kev hloov pauv thaum lub sijhawm beta, tab sis peb tseem muaj qee qhov uas yuav tsum tau hais txog hauv Beta 3 tso tawm. Cov kev hloov no siv tau yog tias koj hloov kho rau Beta 3 los ntawm Beta 2 lossis ib qho qub version ntawm Bootstrap.
Lwm yam
- Tshem tawm qhov
$thumbnail-transition
hloov pauv tsis siv. Peb tsis tau hloov dab tsi, yog li nws tsuas yog ntxiv code. - Lub npm pob tsis suav nrog lwm cov ntaub ntawv uas tsis yog peb qhov chaw thiab cov ntaub ntawv dist; Yog tias koj tso siab rau lawv thiab tab tom khiav peb cov ntawv sau los ntawm cov
node_modules
ntawv tais ceev tseg, koj yuav tsum hloov koj txoj haujlwm ua haujlwm.
Cov ntawv
-
Rewrote ob qho tib si kev cai thiab default checkboxes thiab xov tooj cua. Tam sim no, ob qho tib si muaj cov qauv HTML sib xws (sab nrauv
<div>
nrog cov kwv tij<input>
thiab<label>
) thiab cov qauv tsim tib yam (stacked default, inline with modifier class). Qhov no tso cai rau peb los tsim cov ntawv cim raws li cov lus qhia hauv lub xeev, ua kom yooj yim rau kev txhawb nqa rau tusdisabled
cwj pwm (yav tas los xav tau cov chav kawm niam txiv) thiab txhawb nqa peb daim ntawv validation.Raws li ib feem ntawm qhov no, peb tau hloov CSS rau kev tswj ntau yam
background-image
s ntawm kev cai daim ntawv checkboxes thiab xov tooj cua. Yav dhau los, tam sim no tshem tawm.custom-control-indicator
cov khoom muaj xim tom qab, gradient, thiab SVG icon. Customizing lub keeb kwm yav dhau gradient txhais tau tias hloov tag nrho cov ntawd txhua zaus koj xav tau hloov ib qho xwb. Tam sim no, peb muaj.custom-control-label::before
rau sau thiab gradient thiab.custom-control-label::after
tuav lub icon.Txhawm rau ua qhov kev cai kos hauv kab, ntxiv
.custom-control-inline
. -
Hloov tshiab selector rau input-based khawm pawg. Hloov chaw
[data-toggle="buttons"] { }
rau cov qauv thiab kev coj cwj pwm, peb siv tusdata
cwj pwm tsuas yog rau JS tus cwj pwm thiab tso siab rau cov.btn-group-toggle
chav kawm tshiab rau styling. -
Tshem tawm
.col-form-legend
hauv kev pom zoo ntawm kev txhim kho me ntsis.col-form-label
. Txoj kev no.col-form-label-sm
thiab.col-form-label-lg
tuaj yeem siv rau<legend>
cov ntsiab lus yooj yim. -
Kev cai cov ntaub ntawv nkag tau txais kev hloov pauv rau lawv qhov
$custom-file-text
sib txawv Sass. Nws tsis yog ib daim ntawv qhia Sass nested lawm thiab tam sim no tsuas yog powers ib txoj hlua-lubBrowse
khawm li uas tam sim no tsuas yog pseudo-element generated los ntawm peb Sass. CovChoose file
ntawv tam sim no los ntawm.custom-file-label
.
Input pab pawg
-
Cov tswv yim pab pawg addons tam sim no tshwj xeeb rau lawv qhov kev tso kawm txheeb ze rau cov tswv yim. Peb tau poob
.input-group-addon
thiab.input-group-btn
rau ob chav kawm tshiab,.input-group-prepend
thiab.input-group-append
. Koj yuav tsum tau siv ib qho append los yog prepend tam sim no, ua kom yooj yim ntau ntawm peb CSS. Hauv ib qho append lossis prepend, tso koj cov nyees khawm raws li lawv yuav muaj nyob txhua qhov chaw, tab sis qhwv cov ntawv hauv.input-group-text
. -
Cov qauv kev lees paub tam sim no tau txais kev txhawb nqa, zoo li ntau qhov kev nkag siab (txawm tias koj tsuas tuaj yeem siv tau ib qho kev nkag mus rau ib pawg).
-
Cov chav kawm sizing yuav tsum yog nyob ntawm niam txiv
.input-group
thiab tsis yog cov ntsiab lus ntawm tus kheej.
Beta 2 hloov pauv
Thaum nyob hauv beta, peb xav kom tsis muaj kev hloov pauv. Txawm li cas los xij, txhua yam tsis tas yuav mus raws li kev npaj. Hauv qab no yog cov kev hloov pauv uas yuav tsum nco ntsoov thaum tsiv ntawm Beta 1 mus rau Beta 2.
tawg
- Tshem tawm
$badge-color
qhov sib txawv thiab nws siv rau.badge
. Peb siv cov xim sib txawv los xaiv ib qhocolor
raws li qhovbackground-color
sib txawv, yog li qhov sib txawv tsis tsim nyog. - Renamed
grayscale()
muaj nuj nqi komgray()
tsis txhob cuam tshuam kev tsis sib haum xeeb nrog CSS haiv neeggrayscale
lim. - Renamed
.table-inverse
,.thead-inverse
, thiab.thead-default
,.*-dark
thiab.*-light
, txuam peb cov xim schemes siv lwm qhov. - Cov lus teb tam sim no tsim cov chav kawm rau txhua daim phiaj tawg. Qhov no tawg los ntawm Beta 1 hauv qhov uas
.table-responsive
koj tau siv ntau dua li.table-responsive-md
. Tam sim no koj tuaj yeem siv.table-responsive
lossis.table-responsive-{sm,md,lg,xl}
raws li xav tau. - Poob Bower kev txhawb nqa raws li tus neeg saib xyuas pob tau raug tshem tawm rau lwm txoj hauv kev (xws li xov paj lossis npm). Saib bower/bower #2298 kom paub meej.
- Bootstrap tseem xav tau jQuery 1.9.1 lossis siab dua, tab sis koj tau hais kom siv version 3.x txij li v3.x cov browsers txhawb nqa yog cov Bootstrap txhawb ntxiv rau v3.x muaj qee qhov kev ruaj ntseg kho.
- Tshem tawm cov
.form-control-label
chav kawm tsis siv. Yog hais tias koj tau siv cov chav kawm no, nws yog duplicate ntawm cov.col-form-label
chav kawm uas vertically centered ib tug<label>
nrog nws yog txuam input nyob rau hauv kab rov tav daim ntawv layouts. - Hloov qhov
color-yiq
los ntawm ib qho mixin uas suav nrog covcolor
cuab yeej mus rau ib qho kev ua haujlwm uas xa rov qab tus nqi, tso cai rau koj siv nws rau txhua yam khoom CSS. Piv txwv li, es tsis txhobcolor-yiq(#000)
, koj yuav saucolor: color-yiq(#000);
.
Qhov tseem ceeb
- Qhia
pointer-events
siv tshiab rau cov qauv. Cov txheej txheem.modal-dialog
dhau los ntawm cov xwm txheej nrogpointer-events: none
rau kev cai nias tuav (ua kom nws tsuas yog mloog.modal-backdrop
rau txhua qhov clicks), thiab tom qab ntawd tawm tsam nws rau qhov tseeb.modal-content
nrogpointer-events: auto
.
Cov ntsiab lus
Nov yog cov khoom pib loj uas koj yuav xav paub txog thaum tsiv ntawm v3 rau v4.
Kev them nyiaj yug browser
- Poob IE8, IE9, thiab iOS 6 kev txhawb nqa. v4 tam sim no tsuas yog IE10+ thiab iOS 7+. Rau cov chaw xav tau ib qho ntawm cov ntawd, siv v3.
- Ntxiv kev txhawb nqa rau Android v5.0 Lollipop's Browser thiab WebView. Yav dhau los versions ntawm Android Browser thiab WebView tseem tsuas yog kev txhawb nqa tsis raug cai.
Kev hloov pauv thoob ntiaj teb
- Flexbox tau qhib los ntawm lub neej ntawd. Feem ntau qhov no txhais tau tias txav deb ntawm ntab thiab ntau dua hla peb cov khoom.
- Hloov los ntawm Tsawg rau Sass rau peb cov ntaub ntawv CSS.
- Hloov los ntawm
px
pebrem
lub tsev CSS thawj, txawm hais tias pixels tseem siv rau cov lus nug xov xwm thiab kab sib chaws tus cwj pwm raws li cov khoom siv saib tsis cuam tshuam los ntawm hom loj. - Ntiaj teb no font-loj nce los ntawm
14px
mus rau16px
. - Hloov kho kab sib chaws kom ntxiv ib qho kev xaiv thib tsib (hais txog cov khoom siv me me ntawm
576px
thiab hauv qab) thiab tshem tawm cov-xs
infix los ntawm cov chav kawm ntawd..col-6.col-sm-4.col-md-3
Piv txwv :. - Hloov cov ntsiab lus xaiv cais nrog kev xaiv los ntawm SCSS qhov sib txawv (xws li,
$enable-gradients: true
). - Tsim cov txheej txheem kho dua los siv npm cov ntawv sau tsis yog Grunt. Saib
package.json
rau tag nrho cov ntawv sau, lossis peb qhov project readme rau kev xav tau kev loj hlob hauv zos. - Kev siv tsis teb ntawm Bootstrap tsis tau txais kev txhawb nqa lawm.
- Muab tso rau hauv online Customizer hauv kev pom zoo ntawm ntau cov ntaub ntawv teeb tsa thiab kev tsim kho.
- Ntxiv kaum ob ntawm cov chav kawm siv hluav taws xob tshiab rau CSS cov cuab yeej cuab tam-tus nqi khub thiab cov npoo / padding sib nrug luv luv.
Daim phiaj system
- Hloov mus rau flexbox.
- Ntxiv kev txhawb nqa rau flexbox hauv daim phiaj mixins thiab cov chav kawm ua ntej.
- Raws li ib feem ntawm flexbox, suav nrog kev txhawb nqa rau cov chav kawm ntsug thiab kab rov tav.
- Hloov cov npe kab sib chaws thiab cov kab sib chaws tshiab.
- Ntxiv ib
sm
daim phiaj tshiab hauv qab no768px
kom tswj tau ntau dua. Peb tam sim no muajxs
,sm
,md
,lg
, thiabxl
. Qhov no kuj txhais tau tias txhua qib tau tsoo ib theem (yog li.col-md-6
hauv v3 tam sim no.col-lg-6
hauv v4). xs
Cov chav kawm kab sib chaws tau raug hloov kho kom tsis txhob xav kom cov infix kom raug ntau dua sawv cev tias lawv pib siv cov qauv ntawmmin-width: 0
thiab tsis yog tus nqi pixel. Es tsis txhob.col-xs-6
, nws yog tam sim no.col-6
. Tag nrho lwm cov kab sib chaws yuav tsum muaj qhov infix (piv txwv li,sm
).
- Ntxiv ib
- Hloov kho kab sib chaws, qhov sib xyaw, thiab qhov sib txawv.
- Daim phiaj gutters tam sim no muaj daim ntawv qhia Sass yog li koj tuaj yeem hais qhia qhov dav dav ntawm txhua qhov chaw.
- Hloov kho kab sib chaws mixins los siv ib qho kev
make-col-ready
npaj mixin thiab ib qhomake-col
los teeb tsaflex
thiabmax-width
rau ib tus kab ke qhov loj me. - Hloov daim phiaj xwm txheej xov xwm query breakpoints thiab thawv widths account rau daim phiaj tshiab tier thiab xyuas kom cov kab sib npaug sib npaug los
12
ntawm lawv qhov dav max. - Grid breakpoints thiab thawv widths yog tam sim no tswj los ntawm Sass maps (
$grid-breakpoints
thiab$container-max-widths
) es tsis txhob ntawm ib tug puv tes ntawm txawv variables. Cov no hloov cov kev hloov@screen-*
pauv tag nrho thiab tso cai rau koj los hloov kho tag nrho cov kab sib chaws. - Media queries kuj hloov. Es tsis txhob rov hais dua peb cov lus nug xov xwm tshaj tawm nrog tus nqi qub txhua zaus, peb tam sim no muaj
@include media-breakpoint-up/down/only
. Tam sim no, tsis txhob sau ntawv@media (min-width: @screen-sm-min) { ... }
, koj tuaj yeem sau@include media-breakpoint-up(sm) { ... }
.
Cheebtsam
- Poob panels, thumbnails, thiab qhov dej rau ib tug tshiab tag nrho-encompassing tivthaiv, phaib .
- Tso lub Glyphicons icon font. Yog tias koj xav tau icons, qee qhov kev xaiv yog:
- lub upstream version ntawm Glyphicons
- Octicons
- Font Zoo
- Saib nplooj ntawv Ntxiv rau cov npe ntawm lwm txoj hauv kev. Puas muaj lus qhia ntxiv? Thov qhib qhov teeb meem lossis PR.
- Tso lub Affix jQuery plugin.
- Peb pom zoo kom siv
position: sticky
hloov. Saib HTML5 Thov nkag rau cov ntsiab lus thiab cov lus qhia tshwj xeeb polyfill. Ib qho kev tawm tswv yim yog siv@supports
txoj cai los siv nws (xws li,@supports (position: sticky) { ... }
) - Yog tias koj siv Affix los siv ntxiv, tsis yog
position
hom, polyfills yuav tsis txhawb koj cov ntaub ntawv siv. Ib qho kev xaiv rau kev siv xws li yog lub tsev qiv ntawv thib peb ScrollPos-Styler .
- Peb pom zoo kom siv
- Poob lub pager tivthaiv raws li nws yog qhov tseem ceeb me ntsis customized nyees khawm.
- Refactored ze li ntawm tag nrho cov Cheebtsam los siv ntau un-nested class selectors es tsis txhob ntawm over-specific me nyuam selectors.
Los ntawm cov khoom
Daim ntawv teev npe no qhia txog cov kev hloov pauv tseem ceeb ntawm cov khoom nruab nrab ntawm v3.xx thiab v4.0.0.
Rov pib dua
Tshiab rau Bootstrap 4 yog qhov Reboot , ib daim ntawv tshiab uas tsim los ntawm Normalize nrog peb tus kheej qee qhov kev xav rov pib dua. Cov xaiv uas tshwm sim hauv cov ntaub ntawv no tsuas yog siv cov ntsiab lus-tsis muaj chav kawm ntawm no. Qhov no cais peb cov qauv rov pib dua los ntawm peb cov qauv kev tivthaiv rau ntau txoj hauv kev. Qee qhov tseem ceeb tshaj qhov rov pib dua qhov no suav nrog yog qhov box-sizing: border-box
hloov pauv, hloov mus em
rau rem
cov chav nyob ntawm ntau lub ntsiab lus, txuas cov qauv, thiab ntau daim ntawv rov pib dua.
Typography
- Hloov tag nrho cov
.text-
khoom siv hluav taws xob mus rau cov_utilities.scss
ntaub ntawv. - Poob
.page-header
raws li nws cov qauv tuaj yeem siv los ntawm kev siv hluav taws xob. .dl-horizontal
tau poob lawm. Hloov chaw, siv.row
rau<dl>
thiab siv cov kab ke kab ke (lossis mixins) ntawm nws<dt>
thiab<dd>
menyuam yaus.- Redesigned blockquotes, txav lawv cov qauv ntawm lub
<blockquote>
caij mus rau ib chav kawm,.blockquote
. Poob tus.blockquote-reverse
hloov kho rau cov ntawv siv hluav taws xob. .list-inline
tam sim no xav kom nws cov menyuam teev cov khoom muaj cov.list-inline-item
chav kawm tshiab siv rau lawv.
Duab
- Renamed
.img-responsive
rau.img-fluid
. - Hloov npe
.img-rounded
rau.rounded
- Hloov npe
.img-circle
rau.rounded-circle
Rooj
- Yuav luag txhua qhov xwm txheej ntawm tus
>
xaiv tau raug tshem tawm, lub ntsiab lus nested tables tam sim no yuav tau txais txiaj ntsig los ntawm lawv niam lawv txiv. Qhov no ua rau peb cov neeg xaiv tau yooj yim heev thiab muaj peev xwm customizations. - Renamed
.table-condensed
rau.table-sm
qhov sib xws. - Ntxiv qhov kev
.table-inverse
xaiv tshiab. - Ntxiv cov lus header modifiers:
.thead-default
thiab.thead-inverse
. - Renamed contextual classes kom muaj
.table-
-prefix. Yog li ntawd.active
,.success
,.warning
,.danger
thiab.info
,.table-active
,.table-success
,.table-warning
thiab.table-danger
..table-info
Cov ntawv
- Tsiv cov khoom rov pib dua rau cov
_reboot.scss
ntaub ntawv. - Renamed
.control-label
rau.col-form-label
. - Renamed
.input-lg
thiab.input-sm
mus rau.form-control-lg
thiab.form-control-sm
, ntsig txog. - Cov
.form-group-*
chav kawm poob rau kev yooj yim. Siv.form-control-*
cov chav kawm tam sim no. - Muab pov tseg
.help-block
thiab hloov nws nrog.form-text
rau cov ntawv thaiv qib pab. Rau kev pab hauv kab ntawv thiab lwm yam kev xaiv hloov tau, siv cov chav kawm siv hluav taws xob xws li.text-muted
. - Ua tsaug
.radio-inline
thiab.checkbox-inline
. - Consolidated
.checkbox
thiab.radio
rau hauv.form-check
thiab ntau yam.form-check-*
chav kawm. - Kab rov tav daim ntawv overhauled:
- Tso tseg qhov kev
.form-horizontal
xav tau ntawm chav kawm. .form-group
tsis siv cov qauv los.row
ntawm kev sib xyaw, yog li.row
tam sim no xav tau rau cov kab sib chaws kab rov tav (piv txwv li,<div class="form-group row">
).- Ntxiv
.col-form-label
chav kawm tshiab rau vertically center cov ntawv nrog.form-control
s. - Ntxiv tshiab
.form-row
rau daim ntawv sib cog lus nrog cov chav kawm ntawv (swap koj.row
rau ib qho.form-row
thiab mus).
- Tso tseg qhov kev
- Ntxiv cov ntaub ntawv kev cai txhawb nqa (rau checkboxes, xov tooj cua, xaiv, thiab cov ntaub ntawv nkag).
- Hloov
.has-error
,.has-warning
, thiab.has-success
cov chav kawm nrog HTML5 daim ntawv validation ntawm CSS's:invalid
thiab:valid
pseudo-chav kawm. - Renamed
.form-control-static
rau.form-control-plaintext
.
Khawm
- Renamed
.btn-default
rau.btn-secondary
. - Muab pov tseg hauv
.btn-xs
chav kawm nkaus li.btn-sm
yog proportionally ntau me dua v3's. - Lub xeev khawm feature ntawm
button.js
jQuery plugin tau poob lawm. Qhov no suav nrog cov$().button(string)
txheej$().button('reset')
txheem. Peb qhia siv me me ntawm kev cai JavaScript hloov, uas yuav muaj txiaj ntsig ntawm kev coj tus cwj pwm raws nraim li koj xav tau.- Nco ntsoov tias lwm cov yam ntxwv ntawm lub plugin (khawm checkboxes, khawm xov tooj cua, ib leeg-toggle nyees khawm) tau khaws cia hauv v4.
- Hloov cov nyees khawm '
[disabled]
rau:disabled
raws li IE9 + txhawb nqa:disabled
. Txawm li cas los xijfieldset[disabled]
tseem yog qhov tsim nyog vim tias cov neeg xiam oob khab cov chaw ua haujlwm tseem nyob hauv IE11 .
khawm pawg
- Rewrote tivthaiv nrog flexbox.
- Tshem tawm
.btn-group-justified
. Raws li kev hloov pauv koj tuaj yeem siv<div class="btn-group d-flex" role="group"></div>
los ua cov ntaub qhwv ib ncig ntawm cov khoom nrog.w-100
. - Pov tseg cov
.btn-group-xs
chav kawm tag nrho muab tshem tawm ntawm.btn-xs
. - Tshem tawm qhov sib txawv ntawm qhov sib txawv ntawm cov khawm pawg hauv khawm toolbars; siv margin utilities tam sim no.
- Txhim kho cov ntaub ntawv siv nrog lwm cov khoom.
Dropdowns
- Hloov los ntawm niam txiv selectors mus rau cov chav kawm lus ib leeg rau txhua yam khoom, hloov kho, thiab lwm yam.
- Simplified dropdown styles kom tsis txhob nkoj nrog upward los yog downward tig xub xub txuas mus rau cov ntawv qhia dropdown.
- Dropdowns tuaj yeem tsim nrog
<div>
s lossis<ul>
s tam sim no. - Rebuilt dropdown styles thiab markup kom yooj yim, built-in kev txhawb nqa rau
<a>
thiab<button>
raws li cov khoom poob. - Renamed
.divider
rau.dropdown-divider
. - Cov khoom poob qis tam sim no xav tau
.dropdown-item
. - Dropdown toggles tsis xav tau qhov tseeb
<span class="caret"></span>
; qhov no yog tam sim no muab tau los ntawm CSS's::after
on.dropdown-toggle
.
Daim phiaj system
- Ntxiv ib
576px
daim phiaj tshiab raws lism
, txhais tau tias tam sim no muaj tsib tag nrho cov tiers (xs
,sm
,md
, ,lg
, thiabxl
). - Renamed lub teb cov kab sib hloov hloov cov chav kawm los ntawm
.col-{breakpoint}-{modifier}-{size}
mus.{modifier}-{breakpoint}-{size}
rau cov chav kawm ntawv yooj yim. - Poob thawb thiab rub cov chav kawm hloov kho rau cov chav kawm tshiab flexbox-powered
order
. Piv txwv li, es tsis txhob.col-8.push-4
thiab.col-4.pull-8
, koj yuav siv.col-8.order-2
thiab.col-4.order-1
. - Ntxiv flexbox cov chav kawm siv hluav taws xob rau kab hluav taws xob thiab cov khoom siv.
Sau pawg
- Rewrote tivthaiv nrog flexbox.
- Hloov
a.list-group-item
nrog cov chav kawm qhia meej,.list-group-item-action
, rau styling txuas thiab khawm versions ntawm cov npe pawg khoom. - Ntxiv
.list-group-flush
chav kawm siv nrog daim npav.
Modal
- Rewrote tivthaiv nrog flexbox.
- Muab qhov kev txav mus rau flexbox, kev sib raug zoo ntawm kev tshem tawm cov cim hauv lub taub hau yuav tawg vim tias peb tsis siv ntab lawm. Floated cov ntsiab lus los ua ntej, tab sis nrog flexbox uas tsis yog lawm. Hloov kho koj cov cim tso tawm kom tuaj tom qab lub npe hloov kho.
- Qhov
remote
kev xaiv (uas tuaj yeem siv los thauj khoom thiab txhaj cov ntsiab lus sab nraud rau hauv ib qho qauv) thiab cov xwmloaded.bs.modal
txheej sib raug raug tshem tawm. Peb pom zoo kom siv cov neeg siv khoom-sab templateing lossis cov ntaub ntawv khi cov ntaub ntawv, lossis hu rau jQuery.load koj tus kheej.
Navs
- Rewrote tivthaiv nrog flexbox.
- Tso tseg yuav luag txhua tus
>
xaiv rau kev ua kom yooj yim dua ntawm cov chav kawm uas tsis muaj qhov sib txuas. - Hloov chaw ntawm HTML tshwj xeeb xaiv xws li
.nav > li > a
, peb siv cais cov chav kawm rau.nav
s,.nav-item
s, thiab.nav-link
s. Qhov no ua rau koj HTML hloov tau yooj yim thaum nqa nrog nce ntxiv.
Navbar
Lub navbar tau rov sau tag nrho hauv flexbox nrog txhim kho kev txhawb nqa rau kev sib tw, kev ua haujlwm, thiab kev hloov kho.
- Teb tus cwj pwm navbar tam sim no tau siv rau hauv
.navbar
chav kawm ntawm qhov yuav tsum tau ua.navbar-expand-{breakpoint}
qhov koj xaiv qhov twg kom tawg lub navbar. Yav dhau los qhov no yog qhov hloov pauv tsawg dua thiab yuav tsum tau rov ua dua. .navbar-default
yog tam sim no.navbar-light
, txawm.navbar-dark
tseem zoo li qub. Ib qho ntawm cov no yog xav tau ntawm txhua tus navbar. Txawm li cas los xij, cov chav kawm no tsis tau teeb tsabackground-color
s; es tsis txhob lawv qhov tseem ceeb tsuas cuam tshuamcolor
.- Navbars tam sim no xav tau kev tshaj tawm keeb kwm yav dhau los ntawm qee yam. Xaiv los ntawm peb cov khoom siv yav dhau los (
.bg-*
) lossis teeb tsa koj tus kheej nrog cov chav kawm teeb pom kev zoo / rov qab rau saum toj no rau kev hloov kho siab . - Muab cov qauv flexbox, navbars tam sim no tuaj yeem siv cov khoom siv flexbox rau kev xaiv yooj yim.
.navbar-toggle
yog tam sim no.navbar-toggler
thiab muaj ntau hom thiab sab hauv markup (tsis muaj peb<span>
s).- Poob
.navbar-form
chav kawm nkaus xwb. Nws tsis tsim nyog lawm; Hloov chaw, tsuas yog siv.form-inline
thiab siv cov khoom siv hluav taws xob raws li qhov tsim nyog. - Navbars tsis suav nrog
margin-bottom
lossisborder-radius
los ntawm lub neej ntawd. Siv cov khoom siv hluav taws xob raws li qhov tsim nyog. - Tag nrho cov piv txwv uas muaj navbars tau hloov kho kom suav nrog cov cim tshiab.
Pagination
- Rewrote tivthaiv nrog flexbox.
- Cov chav kawm meej (
.page-item
,.page-link
) tam sim no xav tau ntawm cov xeeb leej xeeb ntxwv ntawm.pagination
s - Poob qhov
.pager
tivthaiv nkaus li nws yog me ntsis ntau dua li cov nyees khawm customized.
Breadcrumbs
- Ib chav kawm meej,
.breadcrumb-item
, yog tam sim no xav tau ntawm cov xeeb leej xeeb ntxwv ntawm.breadcrumb
s
Cov ntawv thiab cov ntawv cim
- Consolidated
.label
thiab.badge
disambiguate los ntawm lub<label>
caij thiab simplify cov feem cuam tshuam. - Ntxiv
.badge-pill
raws li kev hloov kho rau qhov sib npaug "pill" saib. - Cov paib tsis tau ntab tawm lawm hauv cov npe pawg thiab lwm yam. Cov chav kawm siv hluav taws xob tam sim no xav tau rau qhov ntawd.
.badge-default
tau raug muab tso tseg thiab.badge-secondary
ntxiv rau qhov sib tw cov chav kawm hloov kho siv lwm qhov.
Panels, thumbnails, thiab qhov dej
Poob tag nrho rau daim npav tshiab.
Vaj huam sib luag
.panel
rau.card
, tam sim no ua nrog flexbox..panel-default
tshem tawm thiab tsis hloov..panel-group
tshem tawm thiab tsis hloov..card-group
tsis yog hloov, nws txawv..panel-heading
rau.card-header
.panel-title
rau.card-title
. Nyob ntawm seb qhov xav tau, koj tuaj yeem xav siv cov ntsiab lus lossis cov chav kawm (xws li<h3>
,.h3
) lossis cov ntsiab lus loj lossis cov chav kawm (xws li<strong>
,<b>
,.font-weight-bold
). Nco ntsoov tias.card-title
, thaum lub npe zoo sib xws, tsim qhov txawv dua li.panel-title
..panel-body
rau.card-body
.panel-footer
rau.card-footer
.panel-primary
,.panel-success
,.panel-info
,.panel-warning
, thiab.panel-danger
tau poob rau.bg-
,.text-
, thiab.border
cov khoom siv hluav taws xob tsim los ntawm peb$theme-colors
daim ntawv qhia Sass.
Kev vam meej
- Hloov cov
.progress-bar-*
chav kawm sib tham nrog.bg-*
cov khoom siv. Piv txwv li,class="progress-bar progress-bar-danger"
uaclass="progress-bar bg-danger"
. - Hloov
.active
rau animated kev nce qib bar nrog.progress-bar-animated
.
Carousel
- Overhauled tag nrho cov tivthaiv kom yooj yim tsim thiab styling. Peb muaj tsawg tus qauv rau koj hla dhau, cov cim tshiab, thiab cov cim tshiab.
- Tag nrho cov CSS tau raug un-nested thiab renamed, kom ntseeg tau tias txhua chav kawm yog prefixed nrog
.carousel-
.- Rau cov khoom carousel,
.next
,.prev
,.left
, thiab.right
tam sim no.carousel-item-next
,.carousel-item-prev
,.carousel-item-left
, thiab.carousel-item-right
. .item
tseem yog tam sim no.carousel-item
.- Rau kev tswj hwm ua ntej / tom ntej,
.carousel-control.right
thiab.carousel-control.left
tam sim no.carousel-control-next
thiab.carousel-control-prev
, txhais tau tias lawv tsis tas yuav muaj cov chav kawm tshwj xeeb.
- Rau cov khoom carousel,
- Tshem tawm tag nrho cov lus teb styling, deferring rau cov khoom siv hluav taws xob (xws li, qhia cov npe ntawm qee qhov chaw saib) thiab cov qauv kev cai raws li xav tau.
- Tshem tawm cov duab overrides rau cov duab hauv cov khoom carousel, ncua mus rau cov khoom siv hluav taws xob.
- Tweaked Carousel piv txwv kom suav nrog cov cim tshiab thiab cov qauv.
Rooj
- Tshem tawm kev txhawb nqa rau styled nested tables. Tag nrho cov rooj style tam sim no tau txais txiaj ntsig hauv v4 rau cov neeg xaiv yooj yim.
- Ntxiv inverse rooj variant.
Cov khoom siv
- Qhia, zais, thiab lwm yam:
- Ua cov khoom siv hluav taws xob teb (xws li,
.d-none
thiabd-{sm,md,lg,xl}-none
). - Tso tseg cov
.hidden-*
khoom siv hluav taws xob ntau rau cov khoom siv hluav taws xob tshiab . Piv txwv li.hidden-sm-up
, siv.d-sm-none
. Renamed cov.hidden-print
nqi hluav taws xob los siv cov khoom siv hluav taws xob tso npe cov phiaj xwm. Xav paub ntau ntxiv nyob rau hauv nqe lus teb cov nqi hluav taws xob ntawm nplooj ntawv no. - Ntxiv
.float-{sm,md,lg,xl}-{left,right,none}
cov chav kawm rau teb floats thiab tshem tawm.pull-left
thiab.pull-right
txij li thaum lawv nyob nraum redundant rau.float-left
thiab.float-right
.
- Ua cov khoom siv hluav taws xob teb (xws li,
- Hom:
- Ntxiv cov lus teb hloov pauv rau peb cov chav kawm ntawv nyeem
.text-{sm,md,lg,xl}-{left,center,right}
.
- Ntxiv cov lus teb hloov pauv rau peb cov chav kawm ntawv nyeem
- Alignment thiab spacing:
- Ntxiv cov lus teb tshiab thiab cov khoom siv padding rau txhua sab, ntxiv rau ntsug thiab kab rov tav shorthands.
- Ntxiv nkoj thauj khoom ntawm flexbox cov khoom siv .
- Tso
.center-block
rau.mx-auto
chav kawm tshiab.
- Clearfix hloov kho kom poob kev txhawb nqa rau cov browser qub.
Cov neeg muag khoom prefix mixins
Bootstrap 3 tus neeg muag khoom prefix mixins, uas tau deprecated hauv v3.2.0, tau raug tshem tawm hauv Bootstrap 4. Txij li thaum peb siv Autoprefixer , lawv tsis tsim nyog lawm.
Tshem tawm cov mixins hauv qab no: 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
Cov ntaub ntawv
Peb cov ntaub ntawv tau txais kev hloov kho thoob plaws lub rooj tsavxwm thiab. Nov yog qhov qis qis:
- Peb tseem siv Jekyll, tab sis peb muaj plugins hauv kev sib xyaw:
bugify.rb
yog siv los sau cov ntawv nkag ntawm peb nplooj ntawv kab mob zoo .example.rb
yog kev cai diav rawg ntawm lub neej ntawdhighlight.rb
plugin, tso cai rau yooj yim piv txwv-code tuav.callout.rb
yog ib qho kev cai zoo sib xws ntawm qhov ntawd, tab sis tsim los rau peb cov ntaub ntawv tshwj xeeb hu rau.- jekyll-toc yog siv los tsim peb cov ntsiab lus.
- Tag nrho cov ntsiab lus docs tau rov sau dua hauv Markdown (tsis yog HTML) kom kho tau yooj yim dua.
- Cov nplooj ntawv tau raug kho dua tshiab rau cov ntsiab lus yooj yim dua thiab muaj ntau dua hierarchy.
- Peb tau tsiv los ntawm CSS mus rau SCSS kom tau txais txiaj ntsig zoo ntawm Bootstrap qhov hloov pauv, mixins, thiab ntau dua.
Responsive utilities
Txhua @screen-
qhov hloov pauv tau raug tshem tawm hauv v4.0.0. Siv cov media-breakpoint-up()
, media-breakpoint-down()
, lossis media-breakpoint-only()
Sass mixins lossis $grid-breakpoints
Sass daim ntawv qhia hloov.
Peb cov chav kawm siv hluav taws xob teb tau raug tshem tawm ntau heev hauv kev pom zoo ntawm cov display
khoom siv qhia meej.
- Cov
.hidden
thiab.show
cov chav kawm tau raug tshem tawm vim lawv tsis sib haum nrog jQuery$(...).hide()
thiab$(...).show()
cov txheej txheem. Xwb, sim toggling tus[hidden]
cwj pwm los yog siv inline styles nyiamstyle="display: none;"
thiabstyle="display: block;"
. - Tag nrho
.hidden-
cov chav kawm raug tshem tawm, txuag rau cov khoom siv luam tawm uas tau hloov npe.- Tshem tawm ntawm 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
- Tshem tawm ntawm 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
- Tshem tawm ntawm v3:
- Cov khoom siv luam tawm tsis pib nrog
.hidden-
lossis.visible-
, tab sis nrog.d-print-
.- Cov npe qub:
.visible-print-block
,.visible-print-inline
,.visible-print-inline-block
,.hidden-print
- Cov chav kawm tshiab:
.d-print-block
,.d-print-inline
,.d-print-inline-block
,.d-print-none
- Cov npe qub:
Tsis yog siv cov .visible-*
chav kawm qhia meej, koj ua kom pom lub ntsiab lus los ntawm qhov yooj yim tsis zais nws ntawm qhov screen loj. Koj tuaj yeem ua ke ib .d-*-none
chav kawm nrog ib .d-*-block
chav kawm los qhia ib lub ntsiab lus tsuas yog nyob rau ib ntus ntawm qhov ntau thiab tsawg ntawm qhov screen (xws li .d-none.d-md-block.d-xl-none
qhia lub caij tsuas yog hauv cov khoom nruab nrab thiab loj).
Nco ntsoov tias qhov kev hloov pauv rau daim phiaj tawg hauv v4 txhais tau hais tias koj yuav tsum mus rau ib qho kev tawg loj dua kom ua tiav cov txiaj ntsig zoo ib yam. Cov chav kawm siv hluav taws xob tshiab tsis tau sim ua kom haum rau cov xwm txheej tsawg dua qhov uas lub ntsiab lus pom tsis tuaj yeem qhia tau raws li ib qho kev sib txuas ntawm qhov ntau thiab tsawg saib; koj yuav hloov tau siv CSS kev cai nyob rau hauv xws li mob.