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.0.0 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-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" 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.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" 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.0.0'

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

gem install bootstrap -v 4.0.0

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

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