From bbff739243e1d42b60b964fa6b065b10a5a966ee Mon Sep 17 00:00:00 2001 From: Sam Pinkus Date: Wed, 29 Nov 2023 11:40:41 +1000 Subject: [PATCH] Make appending mdi-version query paramt to urls optional. --- scss/_path.scss | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scss/_path.scss b/scss/_path.scss index 6dcf3aa..2c1be39 100644 --- a/scss/_path.scss +++ b/scss/_path.scss @@ -1,10 +1,18 @@ @font-face { + @function mdi-version-string($v, $c) { + $version-string: ""; + @if $v and $v != "0" { + $version-string: "#{$c}#{$v}"; + } + @return $version-string; + } + font-family: '#{$mdi-font-name}'; - src: url('#{$mdi-font-path}/#{$mdi-filename}-webfont.eot?v=#{$mdi-version}'); - src: url('#{$mdi-font-path}/#{$mdi-filename}-webfont.eot?#iefix&v=#{$mdi-version}') format('embedded-opentype'), - url('#{$mdi-font-path}/#{$mdi-filename}-webfont.woff2?v=#{$mdi-version}') format('woff2'), - url('#{$mdi-font-path}/#{$mdi-filename}-webfont.woff?v=#{$mdi-version}') format('woff'), - url('#{$mdi-font-path}/#{$mdi-filename}-webfont.ttf?v=#{$mdi-version}') format('truetype'); + src: url('#{$mdi-font-path}/#{$mdi-filename}-webfont.eot#{mdi-version-string($mdi-version, "?v")}'); + src: url('#{$mdi-font-path}/#{$mdi-filename}-webfont.eot?#iefix#{mdi-version-string($mdi-version, "&v=")}') format('embedded-opentype'), + url('#{$mdi-font-path}/#{$mdi-filename}-webfont.woff2#{mdi-version-string($mdi-version, "?v")}') format('woff2'), + url('#{$mdi-font-path}/#{$mdi-filename}-webfont.woff#{mdi-version-string($mdi-version, "?v")}') format('woff'), + url('#{$mdi-font-path}/#{$mdi-filename}-webfont.ttf#{mdi-version-string($mdi-version, "?v")}') format('truetype'); font-weight: normal; font-style: normal; -} +} \ No newline at end of file