始终移动菜单,Rails 5,bootstrap-rubygem
Always mobile menu, Rails 5, bootstrap-rubygem
我正在使用 Rails 5
和 Twitter Bootstrap gem
(Twitter Bootstrap 4.00.beta2.1)。我正在使用 Carousels 和 Grid 系统,一切正常,但不是导航栏。我正在为 Bootstrap 站点 Bootstrap site 使用导航栏代码,并且始终处于移动状态。
我尝试使用 Bootstrap 而非 bootstrap-rubygem
的新页面,但来自 CDN,导航栏工作正常。对于带有 bootstrap-rubygem
的页面中的示例,我看到:
.collapse {
display: none;
}
在 CDN
中带有 Bootstrap
的页面中,我看到了相同的规则,但另一个 CSS 覆盖了它:
@media (min-width: 992px) _navbar.scss:162
.navbar-toggleable-md .navbar-collapse {
display: -webkit-box!important;
display: -webkit-flex!important;
display: -ms-flexbox!important;
display: flex!important;
width: 100%;
}
并且在带有 bootstrap-rubygem
的页面中,我看不到 @media (min-width: 992px)
的规则
我能做什么?
它在 4.0.0-beta 上发生了变化
将导航栏响应行为更新为移动优先,使用新的 class 名称 .navbar-expand 而不是 .navbar-toggleable,删除切换器位置修饰符(现在依赖于 flex utils) ,并修复了一些错误。
# _navbar.html.slim
nav.navbar.navbar-light.bg-white.navbar-expand-md
按照官方发行说明进行更改,rubygem 没有太多信息https://github.com/twbs/bootstrap/releases
我正在使用 Rails 5
和 Twitter Bootstrap gem
(Twitter Bootstrap 4.00.beta2.1)。我正在使用 Carousels 和 Grid 系统,一切正常,但不是导航栏。我正在为 Bootstrap 站点 Bootstrap site 使用导航栏代码,并且始终处于移动状态。
我尝试使用 Bootstrap 而非 bootstrap-rubygem
的新页面,但来自 CDN,导航栏工作正常。对于带有 bootstrap-rubygem
的页面中的示例,我看到:
.collapse {
display: none;
}
在 CDN
中带有 Bootstrap
的页面中,我看到了相同的规则,但另一个 CSS 覆盖了它:
@media (min-width: 992px) _navbar.scss:162
.navbar-toggleable-md .navbar-collapse {
display: -webkit-box!important;
display: -webkit-flex!important;
display: -ms-flexbox!important;
display: flex!important;
width: 100%;
}
并且在带有 bootstrap-rubygem
的页面中,我看不到 @media (min-width: 992px)
我能做什么?
它在 4.0.0-beta 上发生了变化
将导航栏响应行为更新为移动优先,使用新的 class 名称 .navbar-expand 而不是 .navbar-toggleable,删除切换器位置修饰符(现在依赖于 flex utils) ,并修复了一些错误。
# _navbar.html.slim
nav.navbar.navbar-light.bg-white.navbar-expand-md
按照官方发行说明进行更改,rubygem 没有太多信息https://github.com/twbs/bootstrap/releases