Skoota
Skoota

Reputation: 5290

Efficiently compiling customised Bootstrap LESS

I am using the Bootstrap framework for a website, with heavy customisation. I wanted to make sure that I could still upgrade Bootstrap in the future, so instead of directly modifying the LESS files I have created a separate set of LESS files with my specific customisations (see the "Modularizing Your Changes" section at http://coding.smashingmagazine.com/2013/03/12/customizing-bootstrap/).

At the moment I am compiling the LESS on-the-fly (purely for development purposes) but for performance I will want to compile the LESS files into CSS before putting the site into production. However, because I have customisations I am wary that the CSS file size could be very large, since the original CSS properties will be present in addition to my customisations that override those original properties.

Are there any "smart" LESS compilers which can make this detection and only include the CSS properties that will actually be rendered (rather than all the original properties which have been overridden)? I am looking to minimise the resultant CSS file size as much as possible.

Upvotes: 1

Views: 180

Answers (1)

Jonatan Littke
Jonatan Littke

Reputation: 5663

Unfortunately not.

Given the fact that you're already including Bootstrap which has so many lines of code, your own overrides shouldn't matter too much (unless you have thousands of lines).

On a somewhat related note, see this: http://calendar.perfplanet.com/2011/css-selector-performance-has-changed-for-the-better/

Upvotes: 5

Related Questions