Problem with bootstrap-navbar
There is a problem when using the navbar of bootstrap with meteor. The core problem is described in the video "navbar markup" on this page http://87studios.net/webtuts/twitter-bootstrap-101-the-navbar/. Around one minute after start.
As you can see there, the style of the body has to be included before the bootstrap-responsive.css. Meteor does places the
As workaround you could use absolute positioning for the body.
Regards, Torsten
What's the core problem? The video is a tutorial on the use of the navbar which has nothing to do with Meteor and hence no problem is described.
I did an "empty example" myself with the Navbar and found no problem. There are also nice examples like this where the navbar is used in Meteor.
Tthe problem occures when resizing the browser window to less than 9xx pixels. Than the responsive navbar changes the layout, and the content under it jumps up and down.
Are you saying the problem is that smart package CSS is always included before application CSS, and that the only correct way to use bootstrap-responsive is to have some part of the app CSS come first?
If so, that's a limitation of the current packaging API and useful feedback for the coming rewrite.
Bootstrap documentation says "Add .navbar-fixed-top and remember to account for the hidden area underneath it by adding at least 40px padding to the body. Be sure to add this after the core Bootstrap CSS and before the optional responsive CSS."
So yes, that is a limitation of packaging API.
We will look at this as part of the overhaul of the package system that's going on now.
I just encountered this issue too, and see how it can be a limitation of the packaging api. If more overhaul is going into the packaging or specifically bootstrap—would the package also have the ability to override default less variables?
Two workarounds for the above problem in the meantime:
- Just pull bootstrap directly into your project and name things so they're ordered properly <- gross
- Wrap the padding-top in a min-width
@mediaquery and call it a day, e.g.,
@media (min-width: 980px) { body { padding-top: 60px; } }
@mrcoles, fyi @sixolet is working on allowing to override the bootstrap less variables.
Yuck....I just hit this problem. I was trying to fold a new bootstrap theme into my app and the navbar would no longer be unresponsive (aka, when you take the browser window and narrow it, the navbar no longer collapses under the three line icon...the icon doesn't even show up). I thought it might be because bootstrap is now at 2.3.1 but Meteor's version is 2.3.0 and there were some little 1px .5px changes when I diff'd the css so I tried just copying Meteor's bootstrap.css and changing only the colors into a new .css file. Nope....navbar becomes unresponsive :-P I'm including the .css in my apps main .html file. This is ugly :-(
The bootstrap responsive stuff doesn't work at all for me. I'm not using the smart package, but the download from Twitter's github. Even the most basic, simple page setup with nothing but the fixed navbar doesn't have the responsive behavior when I run my Meteor app.
carlo: how did you install it? If you're using Meteor, all you should need to do is "meteor add bootstrap-ui". If you're trying to install the files yourself over Meteor's bootstrap stuff, it'll fail the way I described because the theme .css you load is after the responsive.css file.
Okay, yeah, I did it via meteor's smart package and it works for the most part. The login UI doesn't work with bootstrap, but I can live with a minimum screen resolution of 1024x768 for now, anyway, so that's fine.
On Tue, Mar 26, 2013 at 7:10 PM, kenyee [email protected] wrote:
carlo: how did you install it? If you're using Meteor, all you should need to do is "meteor add bootstrap-ui". If you're trying to install the files yourself over Meteor's bootstrap stuff, it'll fail the way I described because the theme .css you load is after the responsive.css file.
— Reply to this email directly or view it on GitHubhttps://github.com/meteor/meteor/issues/252#issuecomment-15494711 .
Login UI works ok for me. Kinda ugly, but it'll get cleaned up eventually probably or we'll hopefully get some way to override package templates in our apps.
Couple sources of more info:
See: http://stackoverflow.com/questions/10185384/twitter-bootstrap-responsive-navbar-broken-on-small-screens
https://github.com/twitter/bootstrap/issues/1570
Will show you how they like the ordering of the css. Perhaps will give some insights to the meteor team as to what level of flexibility might need to be desirable to bake in.
FYI, w/ the latest 0.6.3.1, if you use the glyphicons, you have to put your custom theme in /public/packages/bootstrap/css You used to be able to put it in /public and it would resolve the "../img" paths in the theme. And it still breaks the responsiveness of the navbar if you use a custom theme :-P
Possible solution is to upgrade the core bootstrap library to bootstrap3, which recently went live. They've deprecated the bootstrap-responsive.css library.
We intend to change how we maintain 3rd party libraries once we finish https://trello.com/c/d2Hd1Jo1/9-operate-an-official-package-server-and-fold-meteorite-into-meteor
In the meantime, using bootstrap 3 (perhaps from https://atmospherejs.com/package/bootstrap-3 ) is probably what you want.