Using String Variables in SCSS File Paths
When creating this blog, I wanted to use a variable for the file path to my font files, whilst straight forward enough, I couldn't find a clear example in the documents, so here is the code I used.
$file_path: '../fonts/';
@font-face {
font-family: 'roboto_slablight';
src: url(#{$file_path}RobotoSlab-Light-webfont.eot);
src: url(#{$file_path}RobotoSlab-Light-webfont.eot?#iefix) format('embedded-opentype'),
url(#{$file_path}RobotoSlab-Light-webfont.woff) format('woff'),
url(#{$file_path}RobotoSlab-Light-webfont.ttf) format('truetype'),
url(#{$file_path}RobotoSlab-Light-webfont.svg#roboto_slablight) format('svg');
font-weight: normal;
font-style: normal;
}