【问题标题】:bootstrap 4 remove make-row and make-col via scss, cssbootstrap 4 通过 scss、css 删除 make-row 和 make-col
【发布时间】:2018-05-20 17:27:33
【问题描述】:

在 scss 文件中应用 mixins make-row 和 make-col 后,是否也可以通过 scss 文件删除主题?

.contentType {
@include make-row();
&.no-row {
  @include kill-row();
}
}

【问题讨论】:

  • 您是否可以控制元素上类的位置/名称?

标签: sass bootstrap-4 mixins


【解决方案1】:

如果您可以控制元素上类的放置/名称,那么:

.contentType {
    &.row {
        @include make-row();
    }
}

本质上与应用到所有然后使用类(以及较少生成的 CSS)删除相同。 Sass 无法自动取消应用 mixin 中的所有样式,您需要专门针对 kill-row mixin 中的每种样式并重置为默认值。

【讨论】:

    猜你喜欢
    • 2021-09-17
    • 1970-01-01
    • 2013-11-03
    • 1970-01-01
    • 2019-01-21
    • 2011-03-20
    • 2019-06-04
    • 2020-06-23
    • 2018-05-06
    相关资源
    最近更新 更多