Khuphela
Khuphela i-Bootstrap ukuze ufumane i-CSS ehlanganisiweyo kunye neJavaScript, ikhowudi yomthombo, okanye uyifake kunye nabaphathi bephakheji obathandayo njenge-npm, i-RubyGems, kunye nokunye.
I-CSS ehlanganisiweyo kunye ne-JS
Khuphela ikhowudi esele ilungele ukusetyenziswa yeBootstrap v5.0.2 ukuze uwele ngokulula kwiprojekthi yakho, ebandakanya:
- Imiqulu yeCSS ehlanganisiweyo kunye nencitshisiweyo (jonga uthelekiso lweefayile zeCSS )
- Iiplagi zeJavaScript ezihlanganisiweyo nezincitshisiweyo (jonga uthelekiso lweefayile zeJS )
Oku akubandakanyi uxwebhu, iifayile zentsusa, okanye naziphi na ezikhethwayo ezixhomekeke kwiJavaScript njengePopper.
Iifayile zomthombo
Qokelela i-Bootstrap kunye nombhobho we-asethi yakho ngokukhuphela umthombo wethu we-Sass, iJavaScript, kunye neefayile zamaxwebhu. Olu khetho lufuna isixhobo esongezelelweyo:
- Umqokeleli weSass wokuqulunqa iifayile zeSass kwiifayile zeCSS
- I- Autoprefixer ye-CSS yomthengisi isimaphambili
Ukuba ufuna iseti yethu epheleleyo yezixhobo zokwakha , zibandakanyiwe ekuphuhliseni i-Bootstrap kunye nee-docs zayo, kodwa kusenokwenzeka ukuba azilungelanga iinjongo zakho.
Imizekelo
Ukuba ufuna ukukhuphela kwaye ujonge imizekelo yethu , ungabamba imizekelo esele yakhiwe:
CDN nge jsDelivr
Tsiba ukhuphelo ngejsDelivr ukuhambisa uguqulelo olugciniweyo lweBootstrap eqokelelweyo yeCSS kunye neJS kwiprojekthi yakho.
<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>
Ukuba usebenzisa iJavaScript yethu ehlanganisiweyo kwaye ukhetha ukubandakanya iPopper ngokwahlukeneyo, yongeza iPopper phambi kweJS yethu, ngeCDN ngokukhethekayo.
<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>
Abaphathi bephakheji
Tsala iifayile zomthombo weBootstrap phantse kuyo nayiphi na iprojekthi enabaphathi bephakheji abadumileyo. Kungakhathaliseki ukuba umphathi wephakheji, i-Bootstrap iya kufuna i- Sass compiler kunye ne - Autoprefixer yokuseta oluhambelana neenguqulelo zethu ezisemthethweni ezihlanganisiweyo.
npm
Faka i-Bootstrap kwi-apps yakho ye-Node.js ene -npm package :
npm install bootstrap
const bootstrap = require('bootstrap')
okanye import bootstrap from 'bootstrap'
izakulayisha zonke iiplagi zeBootstrap bootstrap
kwinto. Imodyuli bootstrap
ngokwayo ithumela ngaphandle zonke iiplagi zethu. Uyakwazi ukulayisha ngesandla iiplagi zeBootstrap ngabanye ngokulayisha /js/dist/*.js
iifayile phantsi kolawulo lomgangatho ophezulu wepakethe.
I-Bootstrap's package.json
iqulethe i-metadata eyongezelelweyo phantsi kwezi zitshixo zilandelayo:
sass
- indlela eya kwiBootstrap eyona fayile yomthombo weSassstyle
-indlela eya kwi-Bootstrap's non-minified CSS esele ihlanganiswe kusetyenziswa useto olungagqibekanga (akukho ngokwezifiso)
umsonto
Faka i-Bootstrap kwi-Node.js usetyenziso olunikwe amandla ngepakethi yomsonto :
yarn add bootstrap
RubyGems
Faka iBootstrap kwii -apps zakho zeRuby usebenzisa iBundler ( iyacetyiswa ) kunye neRubyGems ngokongeza lo mgca ulandelayo kweyakho Gemfile
:
gem 'bootstrap', '~> 5.0.2'
Kungenjalo, ukuba awusebenzisi i-Bundler, ungafaka i-gem ngokusebenzisa lo myalelo:
gem install bootstrap -v 5.0.2
Jonga gem's FUNDA ngeenkcukacha ezithe vetshe.
Umqambi
Unokufaka kwaye ulawule iSass yeBootstrap kunye neJavaScript usebenzisa uMqambi :
composer require twbs/bootstrap:5.0.2
NuGet
Ukuba uphuhlisa kwi.NET, ungafaka kwaye ulawule iBootstrap's CSS okanye iSass kunye neJavaScript usebenzisa i- NuGet :
Install-Package bootstrap
Install-Package bootstrap.sass