Rekọja si akoonu akọkọ Rekọja si lilọ kiri awọn docs
Check
in English

Gba lati ayelujara

Ṣe igbasilẹ Bootstrap lati gba CSS ti a kojọpọ ati JavaScript, koodu orisun, tabi pẹlu pẹlu awọn oluṣakoso package ayanfẹ rẹ bii npm, RubyGems, ati diẹ sii.

Akojọ CSS ati JS

Ṣe igbasilẹ koodu ti o ṣetan lati lo fun Bootstrap v5.2.1 lati ni irọrun ju silẹ sinu iṣẹ akanṣe rẹ, eyiti o pẹlu:

Eyi ko pẹlu iwe, awọn faili orisun, tabi eyikeyi awọn igbẹkẹle JavaScript yiyan bi Popper.

Gba lati ayelujara

Awọn faili orisun

Ṣe akopọ Bootstrap pẹlu opo gigun ti epo dukia tirẹ nipa gbigba orisun Sass wa, JavaScript, ati awọn faili iwe. Aṣayan yii nilo awọn irinṣẹ afikun:

Ti o ba nilo eto awọn irinṣẹ kikọ wa ni kikun , wọn wa fun idagbasoke Bootstrap ati awọn iwe aṣẹ rẹ, ṣugbọn wọn ṣee ṣe ko yẹ fun awọn idi tirẹ.

Download orisun

Awọn apẹẹrẹ

Ti o ba fẹ ṣe igbasilẹ ati ṣayẹwo awọn apẹẹrẹ wa , o le gba awọn apẹẹrẹ ti a ti kọ tẹlẹ:

Download Awọn apẹẹrẹ

CDN nipasẹ jsDelivr

Rekọja igbasilẹ pẹlu jsDelivr lati ṣafipamọ ẹya cache ti Bootstrap's CSS ti a ṣajọpọ ati JS si iṣẹ akanṣe rẹ.

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script>

Ti o ba nlo JavaScript ti a ṣakopọ wa ti o si fẹ lati pẹlu Popper lọtọ, ṣafikun Popper ṣaaju JS wa, nipasẹ CDN kan ni pataki.

<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous"></script>

Package alakoso

Fa awọn faili orisun Bootstrap sinu fere eyikeyi iṣẹ akanṣe pẹlu diẹ ninu awọn oluṣakoso package olokiki julọ. Laibikita oluṣakoso package, Bootstrap yoo nilo alakojọ Sass kan ati Autoprefixer fun iṣeto ti o baamu awọn ẹya ti a ṣakojọ osise wa.

npm

Fi Bootstrap sori ẹrọ ni awọn ohun elo agbara Node.js rẹ pẹlu package npm :

npm install [email protected]

const bootstrap = require('bootstrap')tabi import bootstrap from 'bootstrap'yoo gbe gbogbo awọn afikun Bootstrap sori bootstrapohun kan. Awọn bootstrapmodule ara okeere gbogbo awọn ti wa afikun. O le fi ọwọ gbe awọn afikun Bootstrap lọkọọkan nipa ikojọpọ awọn /js/dist/*.jsfaili labẹ itọsọna ipele-oke ti package.

Bootstrap's package.jsonni diẹ ninu awọn afikun metadata labẹ awọn bọtini wọnyi:

  • sass- ọna si faili orisun Sass akọkọ Bootstrap
  • style- ọna si Bootstrap ti kii ṣe minimini CSS ti o ti ṣajọpọ nipa lilo awọn eto aiyipada (ko si isọdi)
Bẹrẹ pẹlu Bootstrap nipasẹ npm pẹlu iṣẹ ibẹrẹ wa! Ori si ibi ipamọ awoṣe twbs/bootstrap-npm-starter lati wo bi o ṣe le kọ ati ṣe akanṣe Bootstrap ninu iṣẹ akanṣe npm tirẹ. Pẹlu alakojo Sass, Autoprefixer, Stylelint, PurgeCSS, ati Awọn aami Bootstrap.

owu

Fi Bootstrap sori ẹrọ ni awọn ohun elo agbara Node.js rẹ pẹlu package owu :

RubyGems

Fi Bootstrap sori awọn ohun elo Ruby rẹ nipa lilo Bundler ( ti a ṣe iṣeduro ) ati RubyGems nipa fifi laini atẹle si rẹ Gemfile:

gem 'bootstrap', '~> 5.2.1'

Ni omiiran, ti o ko ba lo Bundler, o le fi fadaka sii nipa ṣiṣe aṣẹ yii:

gem install bootstrap -v 5.2.1

Wo olowoiyebiye's README fun awọn alaye siwaju sii.

Olupilẹṣẹ

O tun le fi sori ẹrọ ati ṣakoso Bootstrap's Sass ati JavaScript nipa lilo Olupilẹṣẹ :

composer require twbs/bootstrap:5.2.1

NuGet

Ti o ba ni idagbasoke ni .NET Framework, o tun le fi sori ẹrọ ati ṣakoso Bootstrap's CSS tabi Sass ati JavaScript nipa lilo NuGet . Awọn iṣẹ akanṣe tuntun yẹ ki o lo libman tabi ọna miiran bi NuGet ṣe apẹrẹ fun koodu akojọpọ, kii ṣe awọn ohun-ini iwaju.

Install-Package bootstrap
Install-Package bootstrap.sass