css - @include 在 SASS 中做什么?

标签 css sass

我是 SASS 和编程语言的新手。

.row 
{
  @include make-row;
}

上面的@include,是不是等同于sass中的@import函数?你能解释一下 @include 的功能吗?

最佳答案

@import 导入整个文件,@include 包含一段@mixin 代码。它允许您创建可重用的代码。

@mixin example($color, $style, $weight) {
  border: $color, $style, $weight;
  width: 100px;
  height: 100px
  padding: 10px;
}

.box { 
  @include example(#000, solid, 1px); 
}

关于css - @include 在 SASS 中做什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33776660/

相关文章:

html - 表头中同一行的 div

html - div height 100% inside td 在ie和opera中计算错误

HTML/CSS 标题格式问题

html - 测试出现在下一列图像的底部

sass - LoadError on line ["55"] of C : cannot load such file -- wdm Run with --trace to see the full backtrace

css - 如何知道在哪里使用 css、less 和 Sass?

html - SASS 仅从根扩展

html - 如何让我的旋转木马仅填充屏幕尺寸的 60%,以便其余部分可供其正下方的面板使用

css - 有没有办法缩短 css 选择器?

html - 我怎样才能制作不规则形状的div