Instɔl Bootstrap in sɔs Sass ɛn JavaSkript fayl dɛn bay npm, RubyGems, Kɔmpozitɔ, ɔ Mitiɔ. Pakɛj manej instɔl dɛn nɔ gɛt dɔkyumentri ɔ wi ful bild skript dɛn. Yu kin yuz wi npm tɛmplat repo bak fɔ kwik kwik wan jenarayz wan Bootstrap projɛkt via npm.
We yu jɔs nid fɔ put Bootstrap in kɔmpilayt CSS ɔ JS, yu kin yuz jsDelivr . Si am in akshɔn wit wi simpul kwik stat , ɔ browz di ɛgzampul dɛn fɔ jompstart yu nɛks prɔjek. Yu kin pik bak fɔ put Popper ɛn wi JS sɛpret wan .
<!-- CSS only --><linkhref="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"rel="stylesheet"integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT"crossorigin="anonymous">
<!-- JavaScript Bundle with Popper --><scriptsrc="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8"crossorigin="anonymous"></script>
Rid wi gayd dɛn fɔ bigin
Gɛt wan jomp pan inklud Bootstrap in sɔs fayl dɛn insay wan nyu prɔjek wit wi ɔfishal gayd dɛn.
Impɔt wan staylshit ɛn yu de ɔf to di res dɛn wit ɛvri ficha na wi CSS.
// Variable overrides first
$primary:#900;$enable-shadows:true;$prefix:"mo-";// Then import Bootstrap
@import"../node_modules/bootstrap/scss/bootstrap";
Bil ɛn ɛkstɛnd insay rial-taym wit CSS vɛriɔbul dɛn
Bootstrap 5 de evolv wit ɛni rilis fɔ bɛtɛ yuz CSS vɛriɔbul fɔ glob ɔl tim stayl dɛn, wan wan kɔmpɔnɛnt dɛn, ɛn ivin yutiliti dɛn. Wi de gi dɔzin vayriɔbul fɔ kɔlɔ, font stayl, ɛn ɔda tin dɛn na wan :rootlɛvul fɔ yuz ɛnisay. Na kɔmpɔnɛnt ɛn yutiliti, CSS vɛriɔbul dɛn de skɔp to di rilevɛns klas ɛn dɛn kin izi fɔ chenj dɛn.
Yuz ɛni wan pan wi glob ɔl :rootvɛriɔbul dɛn fɔ rayt nyu stayl dɛn. CSS vεriεbul dεm de yuz di var(--bs-variableName)sintaks εn kin inhεrit bay pikin εlimεnt dεm.
Nyu insay Bootstrap 5, wi yutiliti dɛn naw na wi Yutiliti API de mek dɛn . Wi bil am as wan Sass map we gɛt bɔku bɔku tin dɛn we yu kin kɔstɔmayz kwik ɛn izi wan. I nɔ ɛva izi fɔ ad, pul, ɔ chenj ɛni yutiliti klas. Mek yutiliti dɛn we de ansa, ad pseudo-klas vayriɔnt dɛn, ɛn gi dɛn kɔstɔm nem dɛn.
// Create and extend utilities with the Utility API
@import"bootstrap/scss/bootstrap";$utilities:map-merge($utilities,("cursor":(property:cursor,class:cursor,responsive:true,values:autopointergrab,)));
Pawaful JavaSkript plɔgin dɛn we nɔ gɛt jQuery
I izi fɔ ad toggleable hiden elements, modals ɛn ɔfkanvas mɛnyu dɛn, popovers ɛn tultips, ɛn bɔku ɔda tin dɛn—ɔl dis we nɔ gɛt jQuery. JavaSkript insay Bootstrap na HTML-fɔs, we min se fɔ ad plɔgin dɛn izi lɛk fɔ ad dataatribyut dɛn. Yu nid fɔ kɔntrol mɔ? Inklud wan wan plɔgin dɛn programmatik wan.
Wetin mek yu fɔ rayt mɔ JavaSkript we yu ebul fɔ rayt HTML? Klose to ɔl di JavaSkript plɔgin dɛn na Bootstrap gɛt fɔs klas data API, we de alaw yu fɔ yuz JavaSkript jɔs bay we yu ad dataatribyut dɛn.
Bootstrap Icons na wan opin sɔs SVG aykɔn laybri we gɛt pas 1,500 glif dɛn, wit mɔ we dɛn ad ɛvri rilis. Dɛn mek dɛn fɔ wok na ɛni prɔjek, ilɛksɛf yu yuz Bootstrap insɛf ɔ yu nɔ yuz am. Yuz dɛn as SVG ɔ aykɔn fɔnt—ɔl tu di opshɔn dɛn de gi yu vektɔ skel ɛn izi kɔstɔmayshɔn tru CSS.
Tek Bootstrap to di nɛks lɛvul wit prɛmiɔm tim dɛn frɔm di ɔfishal Bootstrap Tim dɛn makit . Di tim dɛn bil pan Bootstrap as dɛn yon ɛkstend fremwɔk, rich wit nyu kɔmpɔnɛnt ɛn plɔgin dɛn, dɔkyumentri, ɛn pawaful bil tul dɛn.