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

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

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

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

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

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

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