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.6.2 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 ) .
- JavaScript plugins a wɔaboaboa ano na wɔayɛ no ketewaa (hwɛ JS fael ahorow ntotoho ) .
Eyi nka nkrataa, fibea fael, anaa JavaScript a ɛde ne ho to so biara a wopɛ (jQuery ne Popper).
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.
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:
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-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" 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/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" 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 bootstrap
no ankasa ntumi nkɔ amannɔne. Wubetumi de nsa ahyɛ Bootstrap jQuery plugins no mmiako mmiako denam /js/*.js
fael ahorow a wode bɛhyɛ package no top-level directory ase no so.
Bootstrap's no package.json
kura metadata foforo bi wɔ nsafe a edidi so yi ase:
sass
- kwan a ɛkɔ Bootstrap no Sass fibea fael titiriw no sostyle
- 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.6.2'
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.6.2
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.6.2
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