Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modifying Bootstrap.css and updating the minified version in Visual Studio?

I am using VS Express 2013, trying to customize a bootstrap theme for a Roadkill wiki. I'm trying to replace the body color with a background image.

It's easy enough to modify the bootstrap.css, but in order to get site updates you need to push changes into bootstrap.min.css. So far, I am only aware of how to do this manually. I'm looking for any method whereby I can just have the minified version update automatically.

I'm guessing it's probably really simple to do, but I can't find any steps on how to do this.

like image 694
iontom Avatar asked Feb 19 '14 21:02

iontom


People also ask

What is Minified bootstrap?

bootstrap. min. css has been minified. This means all the whitespace and other extra characters have been removed. This is commonly done for use in production, to reduce the size of the file.

How do you minify CSS and JS files?

To minify CSS, try CSSNano and csso. To minify JavaScript, try UglifyJS. The Closure Compiler is also very effective. You can create a build process that uses these tools to minify and rename the development files and save them to a production directory.

Does Visual Studio have bootstrap?

Bootstrap is an open source toolkit for developing with HTML, CSS, and JS. Visual studio makes it easy to identify which classes are coming from the Bootstrap CSS framework by showing the logo in the completion list.


2 Answers

Just create your own css file and override just the css settings you want to change.

Be sure to load your override css after bootstrap so your overrides take precendence.

This way you dont need to edit either boostrap css at all.

like image 84
Mark Worrall Avatar answered Sep 28 '22 08:09

Mark Worrall


You are right in that it is really easy to do: see http://cssminifier.com/. I just pasted in the entire text of my custom bootstrap file, clicked "Minify", and copied the output back to overwrite the content of bootstrap.min.css. (I took a copy of the .min file first, just to be safe.)

like image 28
PiersB Avatar answered Sep 28 '22 08:09

PiersB