Trying to concatenate Sass variable and a string

こ雲淡風輕ζ 提交于 2019-12-06 08:09:44

You want to interpolate.

$sidebar-width: 20px;

.target {
     width: calc(100% - #{$sidebar-width});
}

Hope this helps

More info into it here: https://webdesign.tutsplus.com/tutorials/all-you-ever-need-to-know-about-sass-interpolation--cms-21375

For a font variable, this is what worked for me:

$font-family-sans-serif:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
$font-family-custom: 'My Custom Font', #{$font-family-sans-serif}

Good Luck

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