Reopen SASS Mixins

↘锁芯ラ 提交于 2019-12-24 12:16:42

问题


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 ?


回答1:


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.

sample.sass:

=test
  color: red
  font-weight: bold

=test
  color: blue

p
  +test

sample.css:

p {
  color: blue; }

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.



来源:https://stackoverflow.com/questions/2943819/reopen-sass-mixins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!