Zazzagewa
Zazzage Bootstrap don samun haɗin CSS da JavaScript, lambar tushe, ko haɗa shi tare da manajojin fakitin da kuka fi so kamar npm, RubyGems, da ƙari.
Haɗa CSS da JS
Zazzage lambar da aka shirya don amfani don Bootstrap v5.2.1 don saukewa cikin sauƙi cikin aikinku, wanda ya haɗa da:
- Haɗe-haɗe da ƙananan gungun CSS (duba kwatancen fayilolin CSS )
- Haɗaɗɗen plugins na JavaScript (duba kwatancen fayilolin JS )
Wannan baya haɗa da takardu, fayilolin tushe, ko kowane abin dogaro na JavaScript na zaɓi kamar Popper.
Fayilolin tushen
Haɗa Bootstrap tare da bututun kadari ta hanyar zazzage tushen mu Sass, JavaScript, da fayilolin takardu. Wannan zaɓin yana buƙatar ƙarin kayan aiki:
- Sass compiler don tattara fayilolin tushen Sass cikin fayilolin CSS
- Autoprefixer don prefixer mai siyar da CSS
Idan kuna buƙatar cikakken saitin kayan aikin ginin mu , an haɗa su don haɓaka Bootstrap da takaddun sa, amma wataƙila ba su dace da manufofin ku ba.
Misalai
Idan kuna son saukewa kuma ku bincika misalan mu , kuna iya ɗaukar misalan da aka riga aka gina:
CDN ta hanyar jsDelivr
Tsallake zazzagewar tare da jsDelivr don isar da sigar cache na Bootstrap's harhada CSS da JS zuwa aikinku.
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script>
Idan kuna amfani da JavaScript ɗinmu da aka haɗa kuma kun fi son haɗawa da Popper daban, ƙara Popper kafin JS ɗin mu, ta CDN zai fi dacewa.
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous"></script>
Manajan kunshin
Ja fayilolin tushen Bootstrap zuwa kusan kowane aiki tare da wasu shahararrun manajan fakitin. Komai manajan fakitin, Bootstrap zai buƙaci mai tara Sass da Autoprefixer don saitin da ya dace da nau'ikan mu na hukuma.
npm
Shigar da Bootstrap a cikin ayyukan Node.js masu ƙarfi tare da fakitin npm :
npm install [email protected]
const bootstrap = require('bootstrap')
ko import bootstrap from 'bootstrap'
za ta loda duk abubuwan plugins na Bootstrap akan wani bootstrap
abu. Tsarin bootstrap
da kansa yana fitar da duk plugins ɗin mu. Kuna iya loda plugins na Bootstrap daban-daban ta hanyar loda /js/dist/*.js
fayilolin a ƙarƙashin babban jagorar matakin fakitin.
Bootstrap's package.json
ya ƙunshi ƙarin ƙarin metadata ƙarƙashin maɓallan masu zuwa:
sass
- hanyar zuwa babban fayil ɗin tushen Sass na Bootstrapstyle
- Hanyar zuwa Bootstrap's mara ƙarancin CSS wanda aka haɗa ta amfani da saitunan tsoho (babu keɓancewa)
yarn
Sanya Bootstrap a cikin kayan aikin Node.js masu ƙarfi tare da kunshin yarn :
yarn add [email protected]
RubyGems
Sanya Bootstrap a cikin aikace-aikacen Ruby ɗinku ta amfani da Bundler ( shawarar ) da RubyGems ta ƙara layin mai zuwa zuwa naku Gemfile
:
gem 'bootstrap', '~> 5.2.1'
A madadin, idan ba kwa amfani da Bundler, zaku iya shigar da gem ta hanyar aiwatar da wannan umarni:
gem install bootstrap -v 5.2.1
Duba gem's README don ƙarin cikakkun bayanai.
Mawaƙiya
Hakanan zaka iya shigar da sarrafa Bootstrap's Sass da JavaScript ta amfani da Mawaƙi :
composer require twbs/bootstrap:5.2.1
NuGet
Idan ka ci gaba a cikin .NET Framework, za ka iya shigarwa da sarrafa Bootstrap's CSS ko Sass da JavaScript ta amfani da NuGet . Sabbin ayyuka yakamata suyi amfani da libman ko wata hanya kamar yadda NuGet aka ƙera don harhada lamba, ba kadarorin gaba ba.
Install-Package bootstrap
Install-Package bootstrap.sass