From d90fb6401644cc152ecea48b2c6b8e1624edd7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fa=20G=C3=BCrdal?= Date: Wed, 24 May 2017 13:40:01 +0200 Subject: [PATCH] fix(Components/DocumentDefault): add woff2 option to fontFace helper (#197) to fix console error with slick font loading --- .../DocumentDefault/BaseStyles/Mixins/_fontFace.styl | 7 +++++-- Components/SliderMedia/style.styl | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Components/DocumentDefault/BaseStyles/Mixins/_fontFace.styl b/Components/DocumentDefault/BaseStyles/Mixins/_fontFace.styl index cdb5b2ab..f9d4c3a1 100644 --- a/Components/DocumentDefault/BaseStyles/Mixins/_fontFace.styl +++ b/Components/DocumentDefault/BaseStyles/Mixins/_fontFace.styl @@ -1,6 +1,9 @@ -fontFace($family, $file, $weight = 'normal', $style = 'normal', $basePath = '../../Components/DocumentDefault/Fonts/') +fontFace($family, $file, $weight = 'normal', $style = 'normal', $woff2 = true, $basePath = '../../Components/DocumentDefault/Fonts/') @font-face font-family: $family - src: url($basePath + $file + '.woff2') format('woff2'), url($basePath + $file + '.woff') format('woff'), url($basePath + $file + '.ttf') format('truetype') + if $woff2 + src: url($basePath + $file + '.woff2') format('woff2'), url($basePath + $file + '.woff') format('woff'), url($basePath + $file + '.ttf') format('truetype') + else + src: url($basePath + $file + '.woff') format('woff'), url($basePath + $file + '.ttf') format('truetype') font-style: unquote($style) font-weight: unquote($weight) diff --git a/Components/SliderMedia/style.styl b/Components/SliderMedia/style.styl index d70d55e6..6570fc2a 100644 --- a/Components/SliderMedia/style.styl +++ b/Components/SliderMedia/style.styl @@ -5,7 +5,7 @@ $rupture.anti-overlap = lookup('$globalRuptureAntiOverlap') || -1px $containerPadding = lookup('$globalContainerPadding') || 15px $containerMaxWidth = lookup('$globalContainerMaxWidth') || 1140px -fontFace('slick', 'slick', normal, normal, '../../vendor/slick/') +fontFace('slick', 'slick', normal, normal, false, '../../vendor/slick/') .flyntComponent[is='flynt-slider-media'] *,