Panagpalawa ti Bootstrap

Ipalawa ti Bootstrap tapno magundawayan dagiti nairaman nga estilo ken dagiti paset, ken dagiti pay LESS a variable ken dagiti mixin.

BASSIT A CSS

Ti Bootstrap ket naaramid nga addaan iti LESS iti kangrunaanna, maysa a dinamiko a pagsasao ti stylesheet a pinartuat babaen ti nasayaat a gayyemtayo, ni Alexis Sellier . Daytoy ket mangaramid ti panagparang-ay kadagiti sistema-a naibatay a CSS a naparpartak, nalaklaka, ken ad-adda a makaay-ayo.

Apay a BASSIT?

Maysa kadagiti nangpartuat ti Bootstrap ket nagsurat ti napardas a blog post maipapan iti daytoy , a nagupgop ditoy:

  • Ti Bootstrap ket agtipon ti naparpartak ~6x a naparpartak nga addaan iti Basbassit no idilig iti Sass
  • Basbassit ti naisurat iti JavaScript, a mangpalaka kadakami ti ag-dive in ken ag-patch no idilig iti Ruby nga addaan iti Sass.
  • Basbassit ti ad-adu; kayatmi a marikna a kasla agsursuratkami iti CSS ken pagbalinenmi a maasitgan ti Bootstrap iti amin.

Ania ti nairaman?

Kas maysa a panagpaatiddog ​​ti CSS, ti LESS ket mangiraman kadagiti variable, dagiti mixin para kadagiti mausar manen a snippet ti kodigo, dagiti panagpataray para iti simple a matematika, panagumok, ken urayno dagiti panagandar ti kolor.

Ammuem ti ad-adu pay

Bisitaen ti opisial a website iti http://lesscss.org/ tapno maammuan ti ad-adu pay.

Gapu ta ti CSS mi ket naisurat babaen ti Less ken agus-usar kadagiti variable ken mixin, daytoy ket kasapulan a maurnong para iti maudi a pannakaipatungpal ti produksion. Ania ti kasano.

Pakaammo: No mangisubmitir ka ti kiddaw ti panagguyod iti GitHub nga addaan iti nabaliwan a CSS, masapul a mangtipon manen ti CSS babaen ti ania man kadagitoy a pamay-an.

Dagiti ramit para iti panagtipon

Node with makefile

Install the LESS command line compiler, JSHint, Recess, and uglify-js globally with npm by running the following command:

$ npm install -g less jshint recess uglify-js

Once installed just run make from the root of your bootstrap directory and you're all set.

Additionally, if you have watchr installed, you may run make watch to have bootstrap automatically rebuilt every time you edit a file in the bootstrap lib (this isn't required, just a convenience method).

Command line

Install the LESS command line tool via Node and run the following command:

$ lessc ./less/bootstrap.less > bootstrap.css

Be sure to include --compress in that command if you're trying to save some bytes!

Javascript

Download the latest Less.js and include the path to it (and Bootstrap) in the <head>.

<link rel="stylesheet/less" href="/path/to/bootstrap.less">
<script src="/path/to/less.js"></script>

To recompile the .less files, just save them and reload your page. Less.js compiles them and stores them in local storage.

Unofficial Mac app

The unofficial Mac app watches directories of .less files and compiles the code to local files after every save of a watched .less file. If you like, you can toggle preferences in the app for automatic minifying and which directory the compiled files end up in.

More apps

Crunch

Crunch is a great looking LESS editor and compiler built on Adobe Air.

CodeKit

Created by the same guy as the unofficial Mac app, CodeKit is a Mac app that compiles LESS, SASS, Stylus, and CoffeeScript.

Simpless

Mac, Linux, and Windows app for drag and drop compiling of LESS files. Plus, the source code is on GitHub.

Quickly start any web project by dropping in the compiled or minified CSS and JS. Layer on custom styles separately for easy upgrades and maintenance moving forward.

Setup file structure

Download the latest compiled Bootstrap and place into your project. For example, you might have something like this:

  app/
  ├── layouts/
  └── templates/
  public/
  ├── css/
     ├── bootstrap.min.css
  ├── js/
     ├── bootstrap.min.js
  └── img/
      ├── glyphicons-halflings.png
      └── glyphicons-halflings-white.png

Utilize starter template

Copy the following base HTML to get started.

  1. <html>
  2. <head>
  3. <title>Bootstrap 101 Template</title>
  4. <!-- Bootstrap -->
  5. <link href="public/css/bootstrap.min.css" rel="stylesheet">
  6. </head>
  7. <body>
  8. <h1>Hello, world!</h1>
  9. <!-- Bootstrap -->
  10. <script src="public/js/bootstrap.min.js"></script>
  11. </body>
  12. </html>

Layer on custom code

Work in your custom CSS, JS, and more as necessary to make Bootstrap your own with your own separate CSS and JS files.

  1. <html>
  2. <head>
  3. <title>Bootstrap 101 Template</title>
  4. <!-- Bootstrap -->
  5. <link href="public/css/bootstrap.min.css" rel="stylesheet">
  6. <!-- Project -->
  7. <link href="public/css/application.css" rel="stylesheet">
  8. </head>
  9. <body>
  10. <h1>Hello, world!</h1>
  11. <!-- Bootstrap -->
  12. <script src="public/js/bootstrap.min.js"></script>
  13. <!-- Project -->
  14. <script src="public/js/application.js"></script>
  15. </body>
  16. </html>