meteor icon indicating copy to clipboard operation
meteor copied to clipboard

Problem with bootstrap-navbar

Open slompf opened this issue 14 years ago • 16 comments

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 .css file after it. Therefor we do not have a chance to make the navbar work as supposed.

As workaround you could use absolute positioning for the body.

Regards, Torsten

slompf avatar Jul 31 '12 19:07 slompf

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.

albertovilla avatar Jul 31 '12 21:07 albertovilla

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.

slompf avatar Aug 01 '12 16:08 slompf

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.

debergalis avatar Sep 20 '12 22:09 debergalis

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.

ghost avatar Nov 29 '12 18:11 ghost

We will look at this as part of the overhaul of the package system that's going on now.

gschmidt avatar Dec 04 '12 02:12 gschmidt

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:

  1. Just pull bootstrap directly into your project and name things so they're ordered properly <- gross
  2. Wrap the padding-top in a min-width @media query and call it a day, e.g.,
@media (min-width: 980px) { body { padding-top: 60px; } }                             

mrcoles avatar Jan 31 '13 04:01 mrcoles

@mrcoles, fyi @sixolet is working on allowing to override the bootstrap less variables.

avital avatar Feb 12 '13 23:02 avital

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 :-(

kenyee avatar Mar 26 '13 19:03 kenyee

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.

cdcme avatar Mar 26 '13 21:03 cdcme

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.

kenyee avatar Mar 26 '13 23:03 kenyee

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 .

cdcme avatar Mar 27 '13 00:03 cdcme

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.

kenyee avatar Mar 27 '13 01:03 kenyee

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.

scott8803 avatar May 16 '13 15:05 scott8803

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

kenyee avatar May 29 '13 22:05 kenyee

Possible solution is to upgrade the core bootstrap library to bootstrap3, which recently went live. They've deprecated the bootstrap-responsive.css library.

awatson1978 avatar Sep 28 '13 02:09 awatson1978

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.

glasser avatar Apr 18 '14 23:04 glasser