Created
July 31, 2019 10:57
-
-
Save MThakkar121/072648888e676d91b3b050a356aff343 to your computer and use it in GitHub Desktop.
Special functions in Sass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$roboto-font-path: "../fonts/roboto" | |
@font-face | |
// This is parsed as a normal function call that takes a quoted string. | |
src: url("#{$roboto-font-path}/Roboto-Thin.woff2") format("woff2") | |
font-family: "Roboto" | |
font-weight: 100 | |
@font-face | |
// This is parsed as a normal function call that takes an arithmetic | |
// expression. | |
src: url($roboto-font-path + "/Roboto-Light.woff2") format("woff2") | |
font-family: "Roboto" | |
font-weight: 300 | |
@font-face | |
// This is parsed as an interpolated special function. | |
src: url(#{$roboto-font-path}/Roboto-Regular.woff2) format("woff2") | |
font-family: "Roboto" | |
font-weight: 400 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment