Tsitsani
Tsitsani Bootstrap kuti mupeze CSS yophatikizidwa ndi JavaScript, khodi yoyambira, kapena muphatikize ndi oyang'anira phukusi omwe mumakonda monga npm, RubyGems, ndi zina zambiri.
Kuphatikizidwa kwa CSS ndi JS
Tsitsani kachidindo kokonzekera kugwiritsa ntchito kwa Bootstrap v5.0.2 kuti mutsike mosavuta polojekiti yanu, yomwe ikuphatikiza:
- Mitolo ya CSS yophatikizidwa komanso yocheperako (onani kufananitsa kwa mafayilo a CSS )
- Mapulagini ophatikizidwa ndi ochepetsedwa a JavaScript (onani kufanana kwa mafayilo a JS )
Izi sizikuphatikiza zolemba, mafayilo oyambira, kapena kudalira kulikonse kwa JavaScript ngati Popper.
Mafayilo oyambira
Sungani Bootstrap ndi payipi yanuyanu potsitsa gwero lathu la Sass, JavaScript, ndi mafayilo olembedwa. Izi zimafuna zida zowonjezera:
- Sass compiler yophatikizira mafayilo a Sass kukhala mafayilo a CSS
- Autoprefixer ya CSS ogulitsa prefixing
Ngati mungafune zida zathu zonse zomangira , zikuphatikizidwa popanga Bootstrap ndi zolemba zake, koma mwina ndizosayenera pazolinga zanu.
Zitsanzo
Ngati mukufuna kutsitsa ndikuwunika zitsanzo zathu , mutha kutenga zitsanzo zomwe zamangidwa kale:
CDN kudzera pa jsDelivr
Lumphani kutsitsa ndi jsDelivr kuti mupereke mtundu wosungidwa wa Bootstrap wopangidwa ndi CSS ndi JS ku projekiti yanu.
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
Ngati mukugwiritsa ntchito JavaScript yathu yophatikizidwa ndipo mumakonda kuphatikiza Popper padera, onjezani Popper pamaso pa JS yathu, kudzera pa CDN makamaka.
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
Oyang'anira phukusi
Kokani mafayilo amtundu wa Bootstrap pafupifupi projekiti iliyonse yokhala ndi oyang'anira phukusi otchuka kwambiri. Ziribe kanthu woyang'anira phukusi, Bootstrap idzafuna Sass compiler ndi Autoprefixer kuti akhazikitse zomwe zikugwirizana ndi mitundu yathu yovomerezeka.
npm
Ikani Bootstrap mu mapulogalamu anu a Node.js omwe ali ndi phukusi la npm :
npm install bootstrap
const bootstrap = require('bootstrap')
kapena import bootstrap from 'bootstrap'
adzatsegula mapulagini onse a Bootstrap pa bootstrap
chinthu. Module bootstrap
yokha imatumiza mapulagini athu onse. Mutha kuyika mapulagini a Bootstrap payekhapayekha pokweza /js/dist/*.js
mafayilo pansi pa chikwatu chapamwamba kwambiri.
Bootstrap's package.json
ili ndi metadata yowonjezera pansi pa makiyi awa:
sass
- njira yopita ku fayilo yayikulu ya Sass ya Bootstrapstyle
- njira yopita ku CSS yosagwirizana ndi Bootstrap yomwe idapangidwa kale pogwiritsa ntchito zosintha (palibe makonda)
ulusi
Ikani Bootstrap mu mapulogalamu anu a Node.js omwe ali ndi phukusi la ulusi :
yarn add bootstrap
RubyGems
Ikani Bootstrap mu mapulogalamu anu a Ruby pogwiritsa ntchito Bundler ( yalimbikitsa ) ndi RubyGems powonjezera mzere wotsatira wanu Gemfile
:
gem 'bootstrap', '~> 5.0.2'
Kapenanso, ngati simukugwiritsa ntchito Bundler, mutha kukhazikitsa mwala wamtengo wapatali poyendetsa lamulo ili:
gem install bootstrap -v 5.0.2
Onani zamtengo wapatali za README kuti mumve zambiri.
Wopeka
Mutha kukhazikitsanso ndikuwongolera Sass ya Bootstrap ndi JavaScript pogwiritsa ntchito Composer :
composer require twbs/bootstrap:5.0.2
NuGet
Ngati mukupanga .NET, mutha kukhazikitsa ndi kuyang'anira CSS ya Bootstrap kapena Sass ndi JavaScript pogwiritsa ntchito NuGet :
Install-Package bootstrap
Install-Package bootstrap.sass