Ku andlala Bootstrap

Andlala Bootstrap ku tirhisa switayele leswi katsekaka na swiphemu, xikan’we na swilo leswi cinca-cincaka swa LESS na mixins.

XITLHANYI XA CSS

Bootstrap yi endliwe hi LESS eka xisekelo xa yona, ririmi ra xitayili lexi cinca-cincaka leri endliweke hi munghana wa hina lonene, Alexis Sellier . Swi endla leswaku ku tumbuluxa CSS leyi sekeriweke eka tisisiteme swi hatlisa, swi olova naswona swi tsakisa.

Ha yini LESWI SWI ENDLIWEKE?

Un’wana wa vatumbuluxi va Bootstrap u tsarile xiviko xa xihatla xa blog mayelana na leswi , lexi katsakanyiweke laha:

  • Bootstrap yi hlengeleta hi ku hatlisa ~6x hi ku hatlisa hi Less loko yi pimanisiwa na Sass
  • Less yi tsariwile hi JavaScript, leswi endlaka leswaku swi hi olovela ku dive in na patch loko swi pimanisiwa na Ruby na Sass.
  • Leswitsongo i swo tala; hi lava ku titwa onge hi tsala CSS hi endla leswaku Bootstrap yi tshineleleka eka hinkwavo.

I yini lexi katsekaka?

Tanihi ku engeteriwa ka CSS, LESS yi katsa swilo leswi cinca-cincaka, mixins ya swiphemu swa khodi leswi tirhisiwaka nakambe, matirhelo ya tinhlayo to olova, ku endla swisaka, hambi ku ri mintirho ya mihlovo.

Dyondza swo tala

Endzela webusayiti ya ximfumo eka http://lesscss.org/ ku dyondza swo tala.

Tanihi leswi CSS ya hina yi tsariweke hi Less naswona yi tirhisaka swilo leswi cinca-cincaka na mixins, yi lava ku hlengeletiwa leswaku ku ta tirhisiwa vuhumelerisi byo hetelela. Hi leyi ndlela leyi.

Xiya: Loko u rhumela xikombelo xo koka eka GitHub hi CSS leyi cinciweke, u fanele ku hlengeleta nakambe CSS hi ku tirhisa yin’wana na yin’wana ya tindlela leti.

Switirhisiwa swo hlengeleta

Layini ya swileriso

Landzelela swiletelo eka project readme eka GitHub ku hlengeleta hi ku tirhisa layini ya swileriso.

JavaScript

Download Less.js ya sweswinyana ivi u katsa ndlela yo ya eka yona (na Bootstrap) eka <head>.

<link rel = "xiphephana xa xitayili/le hansi" href = "/ndlela/ku ya eka/bootstrap.less" > <script src = "/ndlela/ku ya eka/le hansi.js" ></script>  
 

Ku tlhela u hlengeleta tifayela ta .less, ti hlayise ntsena ivi u tlhela u layicha tluka ra wena. Less.js yi ti hlengeleta no ti hlayisa eka vuhlayiselo bya laha kaya.

App ya Mac leyi nga riki ya ximfumo

App leyi nga riki ya ximfumo ya Mac yi hlalela tidayirekitara ta tifayela ta .less naswona yi hlengeleta khodi eka tifayela ta laha kaya endzhaku ka ku hlayisiwa kun’wana ni kun’wana ka fayili ya .less leyi hlaleriweke. Loko u swi tsakela, u nga cinca-cinca leswi u swi tsakelaka eka app leswaku u ta hunguta hi ku tisungulela ni leswaku tifayela leti hlengeletiweke ti hetelelaka ti ri eka xikombo xihi.

Ti-app tin’wana

Ku rhurhumela

Crunch i muhleri ​​na muhlengeleti wa LESS loyi a langutekaka kahle swinene loyi a akiweke eka Adobe Air.

Xitirhisiwa xa Khodi

Yi endliwe hi jaha leri fanaka na app ya Mac leyi nga riki ya ximfumo, CodeKit i app ya Mac leyi hlengeletaka LESS, SASS, Stylus, na CoffeeScript.

Swi nga olovi

Mac, Linux, na Windows app ya ku koka na ku hoxa ku hlengeleta tifayela ta LESS. Ku engetela kwalaho, khodi ya xihlovo yi le ka GitHub .

Hi ku hatlisa sungula phurojeke yihi na yihi ya webu hi ku hoxa eka CSS na JS leswi hlengeletiweke kumbe leswi hungutiweke. Layer eka switayele swa ntolovelo hi ku hambana ku olovisa ku ndlandlamuxiwa na ku hlayisa ku ya emahlweni.

Setup xivumbeko xa fayili

Download Bootstrap ya sweswinyana leyi hlengeletiweke ivi u yi veka eka phurojeke ya wena. Hi xikombiso, u nga ha va ni nchumu wo fana ni lowu:

  app/ .
      swivumbeko/ .
      tithempleyiti/ .
  rivaleni/
      css/ .
          xirhendzevutani xa xirhendzevutani.min.css
      js/ .
          xitsonga xitsonga.min.js
      img/ .
          ti-glyphicon-swiphemu swa hafu.png
          glyphicons-swiphemu swa hafu-yo basa.png

Tirhisa xifaniso xo sungula

Kopa HTML ya xisekelo leyi landzelaka ku sungula.

  1. <html>
  2. <nhloko>
  3. <title> Xifaniso xa Bootstrap 101 </title>
  4. <!-- Xirhendzevutani xa xirhendzevutani -->
  5. <link href = "xitsonga/css/bootstrap.min.css" rel = "xiphephana xa xitayili" >
  6. </head>
  7. <miri>
  8. <h1> Xewani, misava! </h1>
  9. <!-- Xirhendzevutani xa xirhendzevutani -->
  10. <script src = "xitshuriwa xa mani na mani/js/bootstrap.min.js" ></script>
  11. </body>
  12. </html>

Leyara eka khodi ya ntolovelo

Tirha eka CSS ya wena ya ntolovelo, JS, na swin’wana tanihilaha swi lavekaka hakona ku endla Bootstrap ya wena hi tifayela ta wena ta CSS na JS leti hambaneke.

  1. <html>
  2. <nhloko>
  3. <title> Xifaniso xa Bootstrap 101 </title>
  4. <!-- Xirhendzevutani xa xirhendzevutani -->
  5. <link href = "xitsonga/css/bootstrap.min.css" rel = "xiphephana xa xitayili" >
  6. <!-- Phurojeke -->
  7. <link href = "public/css/xitirhisiwa.css" rel = "xiphephana xa xitayili" >
  8. </head>
  9. <miri>
  10. <h1> Xewani, misava! </h1>
  11. <!-- Xirhendzevutani xa xirhendzevutani -->
  12. <script src = "xitshuriwa xa mani na mani/js/bootstrap.min.js" ></script>
  13. <!-- Phurojeke -->
  14. <script src = "xitirhisiwa xa mani na mani/js/xitirhisiwa.js" ></script>
  15. </body>
  16. </html>