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 v4.6.2 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 (jQuery da 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:
jsDelivr
Tsallake zazzagewar tare da jsDelivr don isar da sigar cache na Bootstrap's harhada CSS da JS zuwa aikinku.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" 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/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" 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 bootstrap
require('bootstrap')
za ta loda duk abubuwan jQuery na Bootstrap akan abin jQuery. Shi bootstrap
kansa tsarin ba ya fitar da komai. Kuna iya loda plugins jQuery na Bootstrap da hannu daban-daban ta hanyar loda /js/*.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 riga 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 bootstrap
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', '~> 4.6.2'
A madadin, idan ba kwa amfani da Bundler, zaku iya shigar da gem ta hanyar aiwatar da wannan umarni:
gem install bootstrap -v 4.6.2
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:4.6.2
NuGet
Idan kun haɓaka a cikin NET, zaku iya shigar da sarrafa Bootstrap's CSS ko Sass da JavaScript ta amfani da NuGet :
Install-Package bootstrap
Install-Package bootstrap.sass