0

As I was fixing one of my clients website, I bumped into an odd problem, which I reproduced with another site I made as well. It seems that the bootstrap.min.css and the bootstrap.css files are not the same. (well duh) but as in specified code. For example: I found out that the IMG tag is not propperly handled in the bootstrap.min.css file. I cant find the code for it in the min file, while its normally specified in the bootstrap.css file.

The bootstrap.min.css simply states

img {
    border: 0
}

and later adds

img {
    vertical-align: middle
}

while the bootstrap.css applies:

img {
  width: auto\9;
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
}

For now, I pulled out the piece of CSS specified for the image and put it in my custom stylesheet.

So far this is the only problem I encountered, but somewhere in the back of my head is this voice that whispers: include the other one too, just to catch up any other css problems if they occur...

Whats your oppinion about this? Add the official one too (or toss out the min file and just add the normal one, with making the load time a few miliseconds longer)

2
  • 1
    Can't you just manually minify a new bootstrap.min.css from your bootstrap.css? It is possible that perhaps they got out of sync at some point - for example, bootstrap.css is from bootstrap 3.1 and bootstrap.min.css is from bootstrap 3.0. Commented Jun 3, 2014 at 19:02
  • I think they got out of sync yes, however, they are both the same version. I noticed also some other things that didnt match up. I ll just minify the bootstrap.css file i guess. Commented Jun 3, 2014 at 19:29

2 Answers 2

1

This is a situational problem. You must find out if you're going to be using Bootstrap heavily and often in the future. If that is the case, then you're better off including the non minified version, like you said, in case of future errors. Now, if it is the opposite, then keep the minified version for performance.

Sign up to request clarification or add additional context in comments.

Comments

0

Twitter Bootstrap is a fully functional, heavily used CSS framework. The original code is written in LESS and compiled into CSS for distribution. Part of their compilation includes minifying the full output. This is done using Grunt, a popular NodeJS taskrunner.

There maybe some optimisations in the minified code and hence it seems to vary. Since they also test their code as part of a CI process I feel both the production and minified versions can be trusted.

Checkout their Github and report any issues to them.

https://github.com/twbs/bootstrap

2 Comments

Are you implying that the css minifier removed 6 declarations from the CSS? That seems extremely unlikely.
I'm saying that I trust the Twitter Bootstrap and Node Grunt teams to know what they are doing. I haven't inspected the code myself to that degree, but I trust their test coverage would pick up discrepancies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.