Tsallake zuwa babban abun ciki Tsallake zuwa kewayawa na takardu
in English

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.0.2 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 kamar Popper.

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:

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.

Zazzage tushen

Misalai

Idan kuna son saukewa kuma ku bincika misalan mu , kuna iya ɗaukar misalan da aka riga aka gina:

Zazzage Misalai

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

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

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

const bootstrap = require('bootstrap')ko import bootstrap from 'bootstrap'za ta loda duk abubuwan plugins na Bootstrap akan wani bootstrapabu. Tsarin bootstrapda kansa yana fitar da duk plugins ɗin mu. Kuna iya loda plugins na Bootstrap daban-daban ta hanyar loda /js/dist/*.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)
Fara da Bootstrap ta hanyar npm tare da aikin farawa! Shugaban zuwa wurin ajiyar samfuri na twbs/bootstrap-npm-starter don ganin yadda ake ginawa da keɓance Bootstrap a cikin aikin npm naku. Ya haɗa da mai tara Sass, Autoprefixer, Stylelint, PurgeCSS, da Gumakan Bootstrap.

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', '~> 5.0.2'

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

gem install bootstrap -v 5.0.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:5.0.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