Source

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.0 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 tawm kom haum rau lwm yam khoom siv. Beta 3 thiab laus dua tsuas muaj block, inline-block, inline, thiab none. Stable v4 ntxiv flex, inline-flex, table, table-row, thiab table-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-transitionhloov pauv tsis siv. Peb tsis tau hloov dab tsi, yog li nws tsuas yog ntxiv code.
  • Lub npm pob tsis suav nrog 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_modulesntawv tais ceev tseg, koj yuav tsum hloov kho koj txoj 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 tus disabledcwj 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-images ntawm kev cai daim ntawv checkboxes thiab xov tooj cua. Yav dhau los, tam sim no tshem tawm .custom-control-indicatorcov 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::beforerau sau thiab gradient thiab .custom-control-label::aftertuav 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 tus datacwj pwm tsuas yog rau JS tus cwj pwm thiab tso siab rau cov .btn-group-togglechav kawm tshiab rau styling.

  • Tshem tawm .col-form-legendhauv kev pom zoo ntawm kev txhim kho me ntsis .col-form-label. Txoj kev no .col-form-label-smthiab .col-form-label-lgtuaj 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-textsib txawv Sass. Nws tsis yog ib daim ntawv qhia Sass nested lawm thiab tam sim no tsuas yog powers ib txoj hlua-lub Browsekhawm li uas tam sim no tsuas yog pseudo-element generated los ntawm peb Sass. Cov Choose filentawv 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-addonthiab .input-group-btnrau ob chav kawm tshiab, .input-group-prependthiab .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-groupthiab 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-colorqhov sib txawv thiab nws siv rau .badge. Peb siv cov xim sib txawv los xaiv ib qho colorraws li qhov background-colorsib txawv, yog li qhov sib txawv tsis tsim nyog.
  • Renamed grayscale()muaj nuj nqi kom gray()tsis txhob cuam tshuam kev tsis sib haum xeeb nrog CSS haiv neeg grayscalelim.
  • Renamed .table-inverse, .thead-inverse, thiab .thead-default, .*-darkthiab .*-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-responsivekoj tau siv ntau dua li .table-responsive-md. Tam sim no koj tuaj yeem siv .table-responsivelossis .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-labelchav kawm tsis siv. Yog hais tias koj tau siv cov chav kawm no, nws yog duplicate ntawm cov .col-form-labelchav kawm uas vertically centered ib tug <label>nrog nws yog txuam input nyob rau hauv kab rov tav daim ntawv layouts.
  • Hloov qhov color-yiqlos ntawm ib qho mixin uas suav nrog cov colorcuab 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 txhob color-yiq(#000), koj yuav sau color: color-yiq(#000);.

Qhov tseem ceeb

  • Taw qhia kev pointer-eventssiv tshiab ntawm modals. Cov txheej txheem .modal-dialogdhau los ntawm cov xwm txheej nrog pointer-events: nonerau kev cai nias tuav (ua kom nws tsuas yog mloog .modal-backdroprau txhua qhov clicks), thiab tom qab ntawd tawm tsam nws rau qhov tseeb .modal-contentnrog pointer-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 qhov 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 pxpeb remlub CSS thawj chav tsev, 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 14pxmus rau 16px.
  • Hloov kho kab sib chaws kom ntxiv ib qho kev xaiv thib tsib (hais txog cov khoom siv me me ntawm 576pxthiab hauv qab) thiab tshem tawm cov -xsinfix los ntawm cov chav kawm ntawd. .col-6.col-sm-4.col-md-3Piv 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.jsonrau 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 smdaim phiaj tshiab hauv qab no 768pxkom tswj tau ntau dua. Peb tam sim no muaj xs, sm, md, lg, thiab xl. Qhov no kuj txhais tau tias txhua qib tau tsoo ib theem (yog li .col-md-6hauv v3 tam sim no .col-lg-6hauv v4).
    • xsCov 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 ntawm min-width: 0thiab tsis yog tus nqi pixel. Es tsis txhob .col-xs-6, nws yog tam sim no .col-6. Tag nrho lwm daim phiaj tiers xav tau qhov infix (xws li, sm).
  • Hloov kho daim phiaj loj, mixins, thiab variables.
    • 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-readynpaj mixin thiab ib qho make-collos teeb tsa flexthiab max-widthrau 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 12ntawm lawv qhov dav max.
    • Grid breakpoints thiab thawv dav yog tam sim no tswj los ntawm Sass maps ( $grid-breakpointsthiab $container-max-widths) es tsis txhob ntawm ib tug puv tes ntawm cov sib txawv. Cov no hloov cov hloov @screen-*pauv tag nrho thiab tso cai rau koj los hloov kho 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:
  • Tso lub Affix jQuery plugin.
    • Peb pom zoo kom siv position: stickyhloov. Saib HTML5 Thov nkag rau cov ntsiab lus thiab cov lus qhia tshwj xeeb polyfill. Ib qho kev tawm tswv yim yog siv @supportstxoj cai los siv nws (piv txwv li, @supports (position: sticky) { ... }) /
    • Yog tias koj siv Affix los siv ntxiv, tsis yog positionhom, 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 .
  • 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 cov menyuam tshwj xeeb 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-boxhloov pauv, hloov mus emrau remcov 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.scssntaub ntawv.
  • Poob .page-headerraws li, ib sab ntawm ciam teb, tag nrho nws cov qauv tuaj yeem siv los ntawm kev siv hluav taws xob.
  • .dl-horizontaltau poob lawm. Hloov chaw, siv .rowrau <dl>thiab siv cov chav kawm kab ke (lossis mixins) ntawm nws <dt>thiab <dd>menyuam yaus.
  • Kev cai <blockquote>styling tau tsiv mus rau cov chav kawm - .blockquotethiab tus .blockquote-reversehloov kho.
  • .list-inlinetam sim no xav kom nws cov menyuam teev cov khoom muaj cov .list-inline-itemchav kawm tshiab siv rau lawv.

Duab

  • Renamed .img-responsiverau .img-fluid.
  • Hloov npe .img-roundedrau.rounded
  • Hloov npe .img-circlerau.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.
  • Responsive tables tsis tas yuav muaj cov ntaub qhwv. Xwb, cia li muab txoj .table-responsivecai rau ntawm <table>.
  • Renamed .table-condensedrau .table-smqhov sib xws.
  • Ntxiv qhov kev .table-inversexaiv tshiab.
  • Ntxiv cov lus header modifiers: .thead-defaultthiab .thead-inverse.
  • Renamed contextual classes kom muaj .table--prefix. Yog li ntawd .active, .success, .warning, .dangerthiab .info, .table-active, .table-success, .table-warningthiab .table-danger..table-info

Cov ntawv

  • Tsiv cov khoom rov pib dua rau cov _reboot.scssntaub ntawv.
  • Renamed .control-labelrau .col-form-label.
  • Renamed .input-lgthiab .input-smmus rau .form-control-lgthiab .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-blockthiab hloov nws nrog .form-textrau 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-inlinethiab .checkbox-inline.
  • Consolidated .checkboxthiab .radiorau hauv .form-checkthiab ntau yam .form-check-*chav kawm.
  • Kab rov tav daim ntawv overhauled:
    • Tso tseg qhov kev .form-horizontalxav tau ntawm chav kawm.
    • .form-grouptsis siv cov qauv los .rowntawm kev sib xyaw, yog li .rowtam sim no xav tau rau cov kab sib chaws kab rov tav (piv txwv li, <div class="form-group row">).
    • Ntxiv .col-form-labelchav kawm tshiab rau vertically center cov ntawv nrog .form-controls.
    • Ntxiv tshiab .form-rowrau daim ntawv sib cog lus nrog cov chav kawm ntawv (swap koj .rowrau ib qho .form-rowthiab mus).
  • 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-successcov chav kawm nrog HTML5 daim ntawv validation ntawm CSS's :invalidthiab :validpseudo-chav kawm.
  • Renamed .form-control-staticrau .form-control-plaintext.

Khawm

  • Renamed .btn-defaultrau .btn-secondary.
  • Poob .btn-xschav kawm nkaus li .btn-smyog proportionally ntau me dua v3's.
  • Lub xeev khawm feature ntawm button.jsjQuery 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 :disabledraws li IE9 + txhawb nqa :disabled. Txawm li cas los xij fieldset[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-xschav 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.
  • 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 .dividerrau .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 ::afteron .dropdown-toggle.

Daim phiaj system

  • Ntxiv ib 576pxdaim phiaj tshiab raws li sm, txhais tau tias tam sim no muaj tsib tag nrho tiers ( xs, sm, md, , lg, thiab xl).
  • Renamed lub teb cov kab sib pauv hloov cov chav kawm los ntawm .col-{breakpoint}-{modifier}-{size}mus .{modifier}-{breakpoint}-{size}rau cov chav kawm ntawv yooj yim dua.
  • 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-4thiab .col-4.pull-8, koj yuav siv .col-8.order-2thiab .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-itemnrog cov chav kawm qhia meej, .list-group-item-action, rau styling txuas thiab khawm versions ntawm cov npe pawg khoom.
  • Ntxiv .list-group-flushchav kawm siv nrog daim npav.
  • Rewrote tivthaiv nrog flexbox.
  • Muab txav mus rau flexbox, kev sib raug zoo ntawm kev tshem tawm cov cim hauv lub taub hau yog qhov yuav tawg vim peb tsis siv floats 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 remotekev xaiv (uas tuaj yeem siv los thauj khoom thiab txhaj cov ntsiab lus sab nraud rau hauv ib qho qauv) thiab cov xwm loaded.bs.modaltxheej 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.
  • Rewrote tivthaiv nrog flexbox.
  • Tso tseg ze li ntawm txhua tus >xaiv rau kev styling yooj yim ntawm cov chav kawm uas tsis muaj nyob.
  • Hloov cov HTML tshwj xeeb xaiv xws li .nav > li > a, peb siv cov chav kawm cais rau .navs, .nav-items, thiab .nav-links. Qhov no ua rau koj HTML hloov tau yooj yim thaum nqa nrog nce ntxiv.

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 .navbarchav kawm ntawm qhov yuav tsum tau ua .navbar-expand-{breakpoint} qhov koj xaiv qhov twg los tsoo lub navbar. Yav dhau los qhov no yog qhov hloov pauv tsawg dua thiab xav tau rov ua dua.
  • .navbar-defaultyog tam sim no .navbar-light, txawm .navbar-darktseem 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 tsa background-colors; es tsis txhob lawv qhov tseem ceeb tsuas cuam tshuam color.
  • 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-toggleyog tam sim no .navbar-togglerthiab muaj ntau hom thiab sab hauv markup (tsis muaj peb <span>s).
  • Poob .navbar-formchav kawm nkaus xwb. Nws tsis tsim nyog lawm; Hloov chaw, tsuas yog siv .form-inlinethiab siv cov khoom siv hluav taws xob raws li qhov tsim nyog.
  • Navbars tsis suav nrog margin-bottomlossis border-radiuslos 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 .paginations
  • Poob qhov .pagertivthaiv nkaus li nws yog me ntsis ntau dua li cov nyees khawm customized.
  • Ib chav kawm meej, .breadcrumb-item, yog tam sim no xav tau ntawm cov xeeb leej xeeb ntxwv ntawm .breadcrumbs

Cov ntawv thiab cov ntawv cim

  • Renamed .labelrau .badgedisambiguate los ntawm lub <label>caij.
  • Tso tseg cov .badgekhoom tivthaiv raws li nws yuav luag zoo tib yam rau cov ntawv sau. Siv cov kev .badge-pillhloov kho ua ke nrog rau daim ntawv lo rau qhov sib npaug.
  • 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-defaulttau raug muab tso tseg thiab .badge-secondaryntxiv 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

  • .panelrau .card, tam sim no ua nrog flexbox.
  • .panel-defaulttshem tawm thiab tsis hloov.
  • .panel-grouptshem tawm thiab tsis hloov. .card-grouptsis yog hloov, nws txawv.
  • .panel-headingrau.card-header
  • .panel-titlerau .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-bodyrau.card-body
  • .panel-footerrau.card-footer
  • .panel-primary, .panel-success, .panel-info, .panel-warning, thiab .panel-dangertau poob rau .bg-, .text-, thiab .bordercov khoom siv hluav taws xob tsim los ntawm peb $theme-colorsdaim 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"ua class="progress-bar bg-danger".
  • Hloov .activerau animated kev nce qib bar nrog .progress-bar-animated.
  • 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 .righttam sim no .carousel-item-next, .carousel-item-prev, .carousel-item-left, thiab .carousel-item-right.
    • .itemtseem yog tam sim no .carousel-item.
    • Rau kev tswj hwm ua ntej / tom ntej, .carousel-control.rightthiab .carousel-control.lefttam sim no .carousel-control-nextthiab .carousel-control-prev, txhais tau tias lawv tsis tas yuav muaj cov chav kawm tshwj xeeb.
  • 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

  • Zaub, zais, thiab lwm yam:
    • Ua cov khoom siv hluav taws xob teb (xws li, .d-nonethiab d-{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-printnqi 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-leftthiab .pull-righttxij li thaum lawv nyob nraum redundant rau .float-leftthiab .float-right.
  • Hom:
    • Ntxiv cov lus teb hloov pauv rau peb cov chav kawm ntawv nyeem .text-{sm,md,lg,xl}-{left,center,right}.
  • Alignment thiab spacing:
  • Clearfix hloov tshiab los tso 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.rbyog siv los sau cov ntawv nkag ntawm peb nplooj ntawv kab mob zoo .
    • example.rbyog kev cai diav rawg ntawm lub neej ntawd highlight.rbplugin, tso cai rau yooj yim piv txwv-code tuav.
    • callout.rbyog ib qho kev cai zoo sib xws ntawm qhov ntawd, tab sis tsim los rau peb cov ntaub ntawv tshwj xeeb hu rau.
    • markdown-block.rbyog siv los ua Markdown snippets hauv HTML ntsiab zoo li cov ntxhuav.
    • 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-breakpointsSass 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 displaykhoom siv qhia meej.

  • Cov .hiddenthiab .showcov 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 nyiam style="display: none;"thiab style="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
  • 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

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-*-nonechav kawm nrog ib .d-*-blockchav 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-noneqhia 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.