How to change navbar collapse threshold using Twitter bootstrap-responsive?

后端 未结 14 1066
别那么骄傲
别那么骄傲 2020-12-04 08:18

I\'m using Twitter Bootstrap 2.0.1 in a Rails 3.1.2 project, implemented with bootstrap-sass. I\'m loading both the bootstrap.css and the bootstrap-respon

14条回答
  •  甜味超标
    2020-12-04 09:14

    This is a great example of where you could be using the LESS version of the Bootstrap CSS files. How to do this is below.

    Even better would be to submit this as a pull request on Github so that everyone can benefit and your "custom code" would hopefully be part of Bootstrap moving forward.

    • Add a variable to variables.less that specifies when to collapse the navbar. Something like: @navCollapseWidth: 979px
    • Then modify responsive-navbar.less...
      • Up top change @media (max-width: 979px) to @media (max-width: @navCollapseWidth)
      • At the bottom change @media (min-width: 980px) to @media (max-width: @navCollapseWidth - 1)

    Of course... you'd have to compile LESS using one of the suggested methods.

提交回复
热议问题