Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use bootstrap and LESS and keep a clean project?

I'm developing a web app using python and twitter-bootstrap, and my CSS would really benefit from using LESS in order to generate my styles and themes. I want to inherit from classes provided by bootstrap, which means I've got to get the bootstrap source, and compile my LESS stylesheets against the boostrap .less files.

My question is two-fold:

1) The simplest way it seems to use LESS is not to actually compile stylesheets "on-the-fly" but to have a build step that I run each time I make changes to the styles. Is this typical? It seems like a lot of people run LESS dynamically in their server process, but it's an extra headache that I probably don't need, and I don't want to run less on the client side.

2) Thanks to LESS, my project now depends not just on bootstrap, but the bootstrap "source" - What's the best way to handle this in terms of my project management? I don't want to just absorb the whole of whatever the current version of bootstrap is into my git repos, because it seems like it would be a hassle to update it as newer versions of bootstrap come out (also feels icky!) Still though, I need to have at least the minified js/css in my project tree in order to deploy my app. How do people typically handle dependencies like this when developing web apps?

like image 517
Ryan Avatar asked Sep 29 '12 17:09

Ryan


1 Answers

  1. There are a couple of shoices:
    1. You could use less.js in development, so you don't have to compile each time you change your less code. You just use *.less files instead of *.css
    2. You could use any of the GUI tools that will automatically recompile less code. I prefer LESS.app.
  2. I use git submodule
like image 82
Vladimir Prudnikov Avatar answered Oct 16 '22 08:10

Vladimir Prudnikov