E kūkulu wikiwiki a pane i nā pūnaewele me Bootstrap
ʻO ka mea hana mana, hiki ke hoʻonui ʻia, a piha i nā hiʻohiʻona. E hana a hoʻopilikino me Sass, hoʻohana i ka ʻōnaehana mākia i kūkulu mua ʻia a me nā ʻāpana, a hoʻōla i nā papahana me nā plugins JavaScript ikaika.
E hoʻouka i kā Bootstrap kumu Sass a me nā faila JavaScript ma o npm, RubyGems, Composer, a i ʻole Meteor. ʻAʻole i hoʻokomo ʻia nā palapala a i ʻole kā mākou mau palapala kūkulu piha. Hiki iā ʻoe ke hoʻohana i kā mākou npm template repo e hana wikiwiki i kahi papahana Bootstrap ma o npm.
<!-- 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>
E heluhelu i kā mākou alakaʻi hoʻomaka
E kiʻi i kahi lele ma ka hoʻokomo ʻana i nā faila kumu o Bootstrap i kahi papahana hou me kā mākou alakaʻi alakaʻi.
Hoʻohana ʻo Bootstrap iā Sass no kahi hoʻolālā modular a maʻamau. Hoʻokomo wale i nā ʻāpana āu e pono ai, hiki i nā koho honua e like me nā gradients a me nā aka, a kākau i kāu CSS ponoʻī me kā mākou mau ʻano, palapala ʻāina, nā hana, a me nā hui pū.
Hoʻokomo i hoʻokahi pepa style a hele ʻoe i nā heihei me kēlā me kēia hiʻohiʻona o kā mākou CSS.
// Variable overrides first
$primary:#900;$enable-shadows:true;$prefix:"mo-";// Then import Bootstrap
@import"../node_modules/bootstrap/scss/bootstrap";
Kūkulu a hoʻonui i ka manawa maoli me nā mea hoʻololi CSS
Ke ulu nei ʻo Bootstrap 5 me kēlā me kēia hoʻokuʻu e hoʻohana maikaʻi i nā ʻano CSS no nā ʻano kumuhana honua, nā ʻāpana pākahi, a me nā pono hana. Hāʻawi mākou i nā ʻano like ʻole no nā kala, nā ʻano font, a me nā mea hou aku ma kahi :rootpae no ka hoʻohana ʻana ma nā wahi āpau. Ma nā ʻāpana a me nā pono hana, ua hoʻopili ʻia nā ʻano CSS i ka papa kūpono a hiki ke maʻalahi ke hoʻololi.
E hoʻohana i kekahi o kā mākou mau mea hoʻololi honua:root e kākau i nā ʻano hou. Hoʻohana nā mea hoʻololi CSS i ka var(--bs-variableName)syntax a hiki ke hoʻoili ʻia e nā mea keiki.
Hoʻopau i nā ʻano like ʻole o ka honua, ʻāpana, a i ʻole nā papa hana pono e hoʻopilikino iā Bootstrap e like me kou makemake. ʻAʻole pono e haʻi hou i kēlā me kēia lula, he waiwai hoʻololi hou wale nō.
Mea hou ma Bootstrap 5, ua hana ʻia kā mākou mau pono e kā mākou Utility API . Ua kūkulu mākou iā ia ma ke ʻano he palapala ʻāina Sass i piha i nā hiʻohiʻona hiki ke maʻalahi a maʻalahi. ʻAʻole i maʻalahi ka hoʻohui, hoʻoneʻe, a hoʻololi paha i nā papa pono. E hoʻololi i nā pono hana, hoʻohui i nā ʻano ʻano pseudo-class, a hāʻawi iā lākou i nā inoa maʻamau.
// 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,)));
Nā polokalamu JavaScript ikaika me ka ʻole o jQuery
Hoʻohui maʻalahi i nā mea huna hiki ke hoʻololi ʻia, nā modals a me nā menus offcanvas, nā popovers a me nā mea hana, a me nā mea hou aku - me ka ʻole o jQuery. ʻO JavaScript ma Bootstrap ka HTML-mua, ʻo ia hoʻi ka maʻalahi o ka hoʻohui ʻana i nā plugins e like me ka hoʻohui ʻana i nā ʻano data. Pono ka mana hou? E hoʻokomo i nā plugins pākahi me ka polokalamu.
No ke aha e kākau hou ai i ka JavaScript inā hiki iā ʻoe ke kākau i ka HTML? Ma kahi kokoke i nā plugins JavaScript a Bootstrap e loaʻa i kahi API data papa mua, e ʻae iā ʻoe e hoʻohana iā JavaScript ma ka hoʻohui ʻana datai nā ʻano.
Hōʻike ʻo Bootstrap i kahi mau plugins hiki iā ʻoe ke hāʻule i kekahi papahana. E hoʻokuʻu iā lākou i ka manawa hoʻokahi, a i ʻole e koho i nā mea āu e pono ai.
ʻO Bootstrap Icons kahi waihona waihona ʻona SVG i wehe ʻia e hōʻike ana ma luna o 1,500 glyphs, me nā mea hou aku i kēlā me kēia hoʻokuʻu. Hoʻolālā ʻia lākou e hana i kekahi papahana, inā ʻoe e hoʻohana iā Bootstrap ponoʻī a ʻaʻole paha. E hoʻohana iā lākou ma ke ʻano he SVG a i ʻole nā polokalamu ikona - hāʻawi nā koho ʻelua iā ʻoe i ka scaling vector a me ka hana maʻalahi ma o CSS.
E lawe iā Bootstrap i ka pae aʻe me nā kumumanaʻo premium mai ka mākeke Bootstrap Themes . Kūkulu ʻia nā kumumanaʻo ma Bootstrap e like me kā lākou mau kikoʻī hoʻonui, waiwai me nā mea hou a me nā plugins, palapala, a me nā mea hana ikaika.