重新打开SASS Mixins [英] Reopen SASS Mixins

查看:55
本文介绍了重新打开SASS Mixins的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以重新定义SASS mixins.我想为特定于站点的样式需求覆盖SASS mixin.有办法吗?

Is there a way to redefine SASS mixins. I want to override SASS mixins for site specific styling needs. Is there a way to do it ?

推荐答案

我的快速测试似乎表明,您可以不用考虑就可以覆盖mixins.您无法重新打开它们,而只允许覆盖某些属性,但是可以轻松地完全替换它们.

My quick bit of testing seems to show that you can override mixins without a second thought. You can't reopen them to the extent that would allow you to override only certain attributes, but you can easily replace them entirely.

=test
  color: red
  font-weight: bold

=test
  color: blue

p
  +test

sample.css:

p {
  color: blue; }

请注意,此测试是使用Haml/Sass 3.0.2(Classy Cassidy)执行的,因此,如果您之前遇到错误,则可能不适用于早期版本.

Note that this test was performed using Haml/Sass 3.0.2 (Classy Cassidy), so this may not hold true for earlier versions, if you were getting an error before.

这篇关于重新打开SASS Mixins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆