Fonts Sass Mixin可选参数
我在下面写这封信:Fonts Sass Mixin可选参数,fonts,sass,mixins,Fonts,Sass,Mixins,我在下面写这封信: =font-placeholder($location, $name, $fallback: '', $fallback-style: '') %#{$location}-font font-family: "#{$name}", "#{$fallback}", $fallback-style +font-placeholder($location: body, $name: FontName) 而不是输出以下内容: %body-font { font-f
=font-placeholder($location, $name, $fallback: '', $fallback-style: '')
%#{$location}-font
font-family: "#{$name}", "#{$fallback}", $fallback-style
+font-placeholder($location: body, $name: FontName)
而不是输出以下内容:
%body-font {
font-family: "FontName", "", "";
我希望它输出以下内容:
%body-font {
font-family: "FontName";
有什么帮助吗?如果字符串不需要引号,请不要引用它。那你以后就不必取消报价了 您需要的是字体列表,这样您就不必担心额外的逗号或空字符串
=font-placeholder($location, $fonts...)
%#{$location}-font
font-family: $fonts
+font-placeholder(body, FontName)
+font-placeholder(body, FontName, serif)
+font-placeholder(body, FontName, Arial, sans-serif)
应该生成如下内容:
%body-font {
font-family: FontName;
%body-font {
font-family: FontName, serif;
%body-font {
font-family: FontName, Arial, sans-serif;