Source

Twe

Twe Bootstrap na woanya CSS ne JavaScript a wɔaboaboa ano, source code, anaa fa ka wo package managers a w’ani gye ho te sɛ npm, RubyGems, ne nea ɛkeka ho ho.

Wɔaboaboa CSS ne JS ano

Twe code a wɔaboaboa ano a wɔasiesie sɛ wode bedi dwuma ama Bootstrap v4.4.1 na ɛnyɛ den sɛ wobɛtɔ wo project no mu, a nea ɛka ho ne:

  • CSS bundles a wɔaboaboa ano na wɔayɛ no ketewaa (hwɛ CSS fael ahorow ntotoho ) .
  • Wɔaboaboa JavaScript plugins ano na wɔayɛ no ketewaa

Eyi nka nkrataa, fibea fael, anaa JavaScript a ɛde ne ho to so biara a wopɛ (jQuery ne Popper.js).

Twe

Fael ahorow a wonya fi mu

Boaboa Bootstrap ano denam w’ankasa agyapade pipeline so denam yɛn fibea Sass, JavaScript, ne nkrataa fael ahorow a wobɛtwe no so. Saa nhyehyɛe yi hwehwɛ sɛ wode nnwinnade foforo bi di dwuma:

  • Sass compiler (Libsass anaa Ruby Sass na wɔboa) a wode bɛboaboa wo CSS ano.
  • Autoprefixer a wɔde hyɛ CSS adetɔnfo anim

Should you require build tools , wɔde ka ho ma Bootstrap ne ne docs a wobɛhyehyɛ, nanso ɛbɛyɛ sɛ ɛmfata mma w’ankasa atirimpɔw ahorow.

Twe fibea no fibea

jsDelivr na ɛwɔ hɔ

Skip download no ne jsDelivr na fa Bootstrap CSS ne JS a wɔaboaboa ano no cached version kɔ wo project no mu.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

Sɛ wode yɛn JavaScript a wɔaboaboa ano no redi dwuma a, mma wo werɛ mmfi sɛ wode CDN nkyerɛase ahorow a ɛwɔ jQuery ne Popper.js bɛka ho ansa na ɛreba.

<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>

Package so ahwɛfo

Twe Bootstrap no fibea fael ahorow no kɔ ɛkame ayɛ sɛ adwuma biara a ɛwɔ package managers a agye din sen biara no bi mu. Ɛmfa ho package manager no, Bootstrap bɛhwehwɛ Sass compiler ne Autoprefixer ama nhyehyɛe a ɛne yɛn official compiled versions no hyia.

npm

Install Bootstrap wɔ wo Node.js powered apps no mu denam npm package no so :

npm install bootstrap

require('bootstrap')bɛfa Bootstrap jQuery plugins no nyinaa akɔ jQuery adeɛ no so. Module bootstrapno ankasa ntumi nkɔ amannɔne. Wubetumi de nsa ahyɛ Bootstrap jQuery plugins no mmiako mmiako denam /js/*.jsfael ahorow a wode bɛhyɛ package no top-level directory ase no so.

Bootstrap's no package.jsonkura metadata foforo bi wɔ nsafe a edidi so yi ase:

  • sass- kwan a ɛkɔ Bootstrap no Sass fibea fael titiriw no so
  • style- kwan a ɛkɔ Bootstrap CSS a wɔanyɛ no ketewaa a wɔadi kan aboaboa ano denam nhyehyɛe a wɔde ahyɛ hɔ no so (wɔnyɛ nsakrae biara) .

asaawa a wɔde yɛ nneɛma

Install Bootstrap wɔ wo Node.js powered apps no mu denam yarn package no so :

yarn add bootstrap

RubyAboɔden aboɔ

Install Bootstrap wɔ wo Ruby apps mu denam Bundler ( wɔkamfo kyerɛ ) ne RubyGems denam line a edidi so yi a wode bɛka wo Gemfile:

gem 'bootstrap', '~> 4.4.1'

Sɛnea ɛbɛyɛ a, sɛ womfa Bundler nni dwuma a, wubetumi ahyɛ gem no denam ahyɛde yi a wode bedi dwuma no so:

gem install bootstrap -v 4.4.1

Hwɛ gem no README ma nsɛm pii.

Ɔhyehyɛfo

Wubetumi nso de Composer ahyɛ na woahwɛ Bootstrap no Sass ne JavaScript so :

composer require twbs/bootstrap:4.4.1

NuGet a ɛwɔ hɔ

Sɛ wo nkɔso wɔ .NET mu a, wubetumi nso instɔl na woahwɛ Bootstrap CSS anaa Sass ne JavaScript so denam NuGet :

Install-Package bootstrap
Install-Package bootstrap.sass