简体   繁体   English

Sass mixins获取字体信息

[英]Sass mixins for font information

I was wondering if anyone had come across this. 我想知道是否有人遇到过这个问题。

I'm creating something that uses the same font across different divs, and as such, was going to put the font info into a mixin. 我正在创建在不同的div上使用相同字体的东西,因此将字体信息放入mixin。

I've attached the code below, but my compiler doesn't seem to like it. 我已经附上了下面的代码,但是我的编译器似乎不喜欢它。

any help would be appreciated! 任何帮助,将不胜感激!

@mixin twinpeaksfont {
font-family: arial;
font-size: 80px;
padding-top: 30px;
color:#5e3a38;
-webkit-text-stroke-width: 1.25px;
-webkit-text-stroke-color: #2ab650;
}



#title {
  text-align: center;
  h1 {
    @include twinpeaksfont;
  }

}

Maybe it wants the parenthesis? 也许想要括号?

@mixin twinpeaksfont() {
font-family: arial;
font-size: 80px;
padding-top: 30px;
color:#5e3a38;
-webkit-text-stroke-width: 1.25px;
-webkit-text-stroke-color: #2ab650;
}



#title {
  text-align: center;
  h1 {
    @include twinpeaksfont;
  }

}

With or without the parenthesis, it's working at JSfiddle 有或没有括号,它都可以在JSfiddle中使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM