Source

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.1.3 don saukewa cikin sauƙi cikin aikinku, wanda ya haɗa da:

Wannan baya haɗa da takardu, fayilolin tushe, ko kowane abin dogaro na JavaScript na zaɓi (jQuery da Popper.js).

Zazzagewa

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 (Libsass ko Ruby Sass ana goyan bayan) don haɗa CSS ɗin ku.
  • Autoprefixer don prefixer mai siyar da CSS

Idan kuna buƙatar kayan aikin ginawa , an haɗa su don haɓaka Bootstrap da takaddun sa, amma wataƙila ba su dace da manufofin ku ba.

Zazzage tushen

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-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

Idan kuna amfani da JavaScript ɗinmu da aka haɗa, kar ku manta da haɗa nau'ikan CDN na jQuery da Popper.js kafinsa.

<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" 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 bootstrapkansa tsarin ba ya fitar da komai. Kuna iya loda plugins jQuery na Bootstrap da hannu daban-daban ta hanyar loda /js/*.jsfayilolin a ƙarƙashin babban jagorar matakin fakitin.

Bootstrap's package.jsonya ƙunshi ƙarin ƙarin metadata ƙarƙashin maɓallan masu zuwa:

  • sass- hanyar zuwa babban fayil ɗin tushen Sass na Bootstrap
  • style- Hanyar zuwa Bootstrap's mara ƙarancin CSS wanda aka riga aka haɗa ta amfani da saitunan tsoho (babu keɓancewa)

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.1.3'

A madadin, idan ba kwa amfani da Bundler, zaku iya shigar da gem ta hanyar aiwatar da wannan umarni:

gem install bootstrap -v 4.1.3

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.1.3

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