Tɛmɛn ka taa kunnafoni kunbabaw la Tɛmɛn ka taa docs navigation kan
Check
in English

Ka bolomafara di

Dɛmɛ ka Bootstrap labɛn ni an ka sɛbɛnw ye ka sɛbɛnniw ni kɔrɔbɔliw jɔ.

Baarakɛminɛnw sigicogo

Bootstrap bɛ baara Kɛ ni npm sɛbɛnniw ye walasa ka sɛbɛnniw jɔ ani ka source filew lajɛ. An ka package.json bɛ nin sɛbɛnni ninnu mara walasa ka kode dalajɛ, ka sɛgɛsɛgɛliw kɛ, ani fɛn wɛrɛw. Ninnu ma dabɔ baara kama an ka fɛnmarayɔrɔ ni sɛbɛnw kɔkan.

Walasa ka baara kɛ ni an ka build system ye ani k’an ka sɛbɛnw baara sigida la, i mago bɛ Bootstrap ka source files ni Node kopi dɔ la. Aw bɛ nin fɛɛrɛ ninnu labato ani aw ka kan ka labɛn ka girin:

  1. Node.js , an bɛ baara Kɛ ni min ye walasa k’an ka dannayakow ɲɛnabɔ, o telesarse k’a Blà a la.
  2. Bootstrap ka sɔrɔyɔrɔw telesarse walima ka Bootstrap ka marayɔrɔ foroko .
  3. aw bɛ taa root /bootstrapdirectory la ka boli npm installwalasa k' an ka sigida dantigɛliw sigi sen kan minnu kofɔlen bɛ package.json kɔnɔ .

Ni a dafara, i bɛ se ka cikan suguya minnu di ka bɔ cikan yɔrɔ la, i bɛ se ka olu baara.

Baara kɛ ni npm sɛbɛnniw ye

An ka package.json kɔnɔ, baara caman bɛ yen porozɛ in yiriwali kama. Boli npm runka npm sɛbɛnniw bɛɛ ye i ka terminal kɔnɔ. Baara fɔlɔw ye ninnu ye:

Baara Cogojirali
npm start A bɛ CSS ni JavaScript lajɛ, ka sɛbɛnw jɔ, ka sigida baarakɛla dɔ daminɛ.
npm run dist A bɛ dist/ɲɛbilasɛbɛn Dabɔ ni dosiyew lajɛlenw ye. A bɛ baara kɛ ni Sass , Autoprefixer ani terser ye .
npm test A bɛ boli sɛgɛsɛgɛliw kɛ sigida la boli kɔfɛnpm run dist
npm run docs-serve A bɛ sɛbɛnw jɔ ani k’u baara sigida la.
Aw ye Bootstrap daminɛ npm fɛ ni an ka daminɛ porozɛ ye! Aw bɛ taa twbs/bootstrap-npm-starter jatebɔyɔrɔ la walasa ka Bootstrap jɔcogo n’a labɛncogo lajɛ aw yɛrɛ ka npm porozɛ kɔnɔ. Sass daɲɛgafe, Autoprefixer, Stylelint, PurgeCSS ani Bootstrap Icons bɛ yen.

Sass ye

Bootstrap bɛ baara Kɛ ni Dart Sass ye walasa k’an ka Sass source filew Lajɛ ka Kɛ CSS filew ye (min bɛ an ka jɔli taabolo la), wa an b’a Fɔ i ye ko i k’o ɲɔgɔn Kɛ n’i bɛ Sass Lajɛ ni i yɛrɛ ka nafolo pipeline ye. An tun bɛ baara Kɛ ni Node Sass ye ka Tɛmɛ Bootstrap v4 kama, nka LibSass ni pake minnu jɔlen dòn a san fɛ, Node Sass fana sen bɛ o la, olu ma baara Kɛ sisan .

Dart Sass bɛ baara Kɛ ni 10 ye min bɛ Lamini tigitigi ani baarakɛcogo ɲuman kunw na a tɛ Sɔn o nafa in ladilanni ma. An tɛ nin tiɲɛni in Dɔgɔya an ka CSS labɛnnenw baaracogo wɛrɛw senfɛ, i n’a fɔ fɛn fitininw kɛtuma na, nka n’i y’a sugandi k’o kɛ an b’a ɲini i fɛ i ka tiɲɛni kɛcogo 6 mara a dɔgɔyalenba la walasa ka gɛlɛyaw bali ni navigatɔrɔw laminiko ye.

Yɛrɛ-prefixer (Yɔrɔ-fɔcogo)

Bootstrap bɛ baara Kɛ ni Autoprefixer ye (min bɛ an ka jɔli taabolo la) walasa ka feerekɛlaw ka ɲɛfɔlisenw Fàra a yɛrɛma CSS nafolo dɔw kan jɔli waati la. O kɛli bɛ waati ni kode kisi an ma ni a b’a to an bɛ se k’an ka CSS yɔrɔ kolomaw sɛbɛn siɲɛ kelen k’a sɔrɔ an bɛ feerekɛlaw ka mixinw mago bɔ i n’a fɔ minnu bɛ sɔrɔ v3 kɔnɔ.

An bɛ navigatɔrɔw lisɛli mara minnu bɛ dɛmɛ sɔrɔ Autoprefixer fɛ dosiye wɛrɛ kɔnɔ an ka GitHub marayɔrɔ kɔnɔ. Aw ye .browserslistrc lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ.

RTLCSS ye

Bootstrap bɛ baara Kɛ ni RTLCSS ye walasa ka CSS lajɛlenw baara k’u Labɛn ka Kɛ RTL ye – a basigilen bɛ horizontal direction aware properties (misali padding-leftla ) nɔ na n’u kɔkanna ye. A b’a To an bɛ an ka CSS sɛbɛn siɲɛ kelen dɔrɔn ani ka fɛn misɛnninw Kɛ ni RTLCSS control ani value directives ye.

Sigida sɛbɛnw

An ka sɛbɛnw bolicogo sigida la, o bɛ Hugo baara de wajibiya, o min bɛ Sìgiyɔrɔma hugo-bin npm pake fɛ. Hugo ye blazingly fast and quite extensible static site generator ye min bɛ an Di: basigiw bɛ yen, Markdown-based files, templates, ani fɛn wɛrɛw. A daminɛcogo filɛ nin ye:

  1. Boli ka tɛmɛ baarakɛminɛnw sigicogo kan sanfɛ walasa ka dependencies bɛɛ sigi sen kan.
  2. Ka bɔ root /bootstrapdirectory la, i ka boli npm run docs-servecikan yɔrɔ la.
  3. Da wuli http://localhost:9001/i ka navigatɛri kɔnɔ, ani voilà.

Aw ye kunnafoni wɛrɛw sɔrɔ Hugo baaracogo kan n' a ka sɛbɛnw kalanni ye .

Gɛlɛyaw ɲɛnabɔli

Ni i ye gɛlɛya sɔrɔ dependencies (daɲɛw sigili) la, i ka dependency version kɔrɔw bɛɛ bɔ (dugukolo kan ani sigida la). O kɔfɛ, i ka segin ka npm installbaara kɛ .