Twe kɔ emu nsɛm atitiriw no so Twe kɔ docs navigation so

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 v5.1.3 na ɛnyɛ den sɛ wobɛtɔ wo project no mu, a nea ɛka ho ne:

Eyi nka nkrataa, fael ahorow a wonya fi mu, anaa JavaScript a ɛde ne ho to so biara a wopɛ te sɛ Popper ho.

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 a wɔde boaboa Sass source fael ahorow ano kɔ CSS fael ahorow mu
  • Autoprefixer a wɔde hyɛ CSS adetɔnfo anim

Should you require our full set of build tools , wɔde ka ho ma Bootstrap ne ne docs a wobɛhyehyɛ, nanso ɛda adi sɛ ɛmfata mma w’ankasa atirimpɔw ahorow.

Twe fibea no fibea

Nhwɛso ahorow

Sɛ wopɛ sɛ wotwe na wohwehwɛ yɛn nhwɛso ahorow no mu a , wubetumi afa nhwɛso ahorow a wɔasisi dedaw no:

Twe Nhwɛso Ahorow

CDN nam jsDelivr so

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

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

Sɛ wode yɛn JavaScript a wɔaboaboa ano no redi dwuma na wopɛ sɛ wode Popper ka ho wɔ ɔkwan soronko so a, fa Popper ka ho ansa na yɛn JS no aba, denam CDN so a ɛbɛyɛ papa.

<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-7+zCNj/IqJ95wo16oMtfsKbZ9ccEh31eOz1HGyDuCQ6wgnyJNSYdrPa03rtR1zdB" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" 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

const bootstrap = require('bootstrap')anaasɛ import bootstrap from 'bootstrap'ɛbɛde Bootstrap no plugins nyinaa ahyɛ bootstrapade bi so. Module bootstrapno ankasa de yɛn plugins no nyinaa kɔ amannɔne. Wubetumi de nsa ahyɛ Bootstrap no plugins no mmiako mmiako denam /js/dist/*.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ɔnnyɛ nsakrae biara) .
Fi ase ne Bootstrap via npm ne yɛn starter project! Fa w’ani kyerɛ twbs/bootstrap-npm-starter template repository no mu kɔhwɛ sɛnea wobɛkyekye na woayɛ Bootstrap wɔ w’ankasa npm adwuma no mu. Sass compiler, Autoprefixer, Stylelint, PurgeCSS, ne Bootstrap Ahyɛnsodeɛ ka ho.

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', '~> 5.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 5.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:5.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