3 回答
TA贡献1813条经验 获得超2个赞
要取消激活非桌面样式,您只需更改variables.less文件中的4行代码。在variables.less文件中设置屏幕宽度断点,如下所示:
//媒体查询断点
// ------------------------------------------------ -
//超小屏幕/手机
//注意:自v3.0.1起,已弃用@ screen-xs和@ screen-phone
@ screen-xs:1px;
@ screen-xs-min:@ screen-xs;
@ screen-phone:@ screen-xs-min;
//小屏幕/平板电脑
//注意:从v3.0.1开始,已弃用@ screen-sm和@ screen-tablet
@ screen-sm:2px;
@ screen-sm-min:@ screen-sm;
@ screen-tablet:@ screen-sm-min;
//中等屏幕/桌面
//注意:从v3.0.1开始,已弃用@ screen-md和@ screen-desktop
@ screen-md:3px;
@ screen-md-min:@ screen-md;
@ screen-desktop:@ screen-md-min;
//大屏幕/宽桌面
//注意:从v3.0.1开始不推荐使用@ screen-lg和@ screen-lg-desktop
@ screen-lg:9999px;
@ screen-lg-min:@ screen-lg;
@ screen-lg-desktop:@ screen-lg-min;
这会将桌面样式媒体查询的最小宽度设置为较低,以便它适用于所有屏幕宽度。感谢2calledchaos的改进!一些基本样式在移动样式中定义,因此我们需要确保包含它们。
编辑:chris注意到您可以在bootstrap站点上的online less编译器中设置这些变量
- 3 回答
- 0 关注
- 458 浏览
添加回答
举报