bootstrap-4 - Bootstrap 4中是否有间距混合?
问题描述
Bootstrap 4 提供了一堆间距类,它们都使用 $spacer SASS 变量。
https://getbootstrap.com/docs/4.1/utilities/spacing/
是否有任何 mixins,以便在不能(或不想)修改 html 并添加相关类的情况下将这些间距应用于元素?因此,对于没有引导类的元素,可能会有间距取决于 $spacer 值,
例如像
.myClass {
@include mt-1; //behaves like adding the mt-1 class to the element itself
}
解决方案
我不确定你为什么需要一个mixin。为什么不简单地在自定义类上使用 $spacer 变量?
.myClass {
margin-top: $spacer*.25;
}
推荐阅读
- python - 在pandas df中为每个id(特定于每个id检查重复项)在df中查找重复项
- r - Grepl字符串组和所有使用R的计数频率
- reactjs - 反应状态对象输入不能使用修剪
- c - 当我尝试从用户那里获取联系电话并打印时,它始终显示为 0
- firebase - 试图在firebase firestore中包含范围比较(<=)和orderBy,但它不起作用
- javascript - JavaScript 上的 FFMPEG 命令
- python-3.x - 如何获取 packet.tcp.payload 和 packet.http.data 作为字符串?
- c++ - 调试 python C++ 模块 Visual Studio 和 VSCode 时激活 conda 环境
- c++ - 如何在linux中捕获和修改鼠标事件?
- c# - 从 Xamarin 上的 firebase 获取用户时如何按名称排序