From bd8ed31e5d0131b660003c62d15eb5109777a6c7 Mon Sep 17 00:00:00 2001 From: PhilippeVay Date: Fri, 16 Dec 2016 22:24:37 +0100 Subject: [PATCH] No effect if variable is null or doesn't exist --- sass/_config/_variables.scss | 5 +++-- sass/library/_base.scss | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sass/_config/_variables.scss b/sass/_config/_variables.scss index 0c29b4b..1dfbbe3 100644 --- a/sass/_config/_variables.scss +++ b/sass/_config/_variables.scss @@ -26,8 +26,9 @@ $color5 : #6FA939 !default; $base-color: $color1; $link-color: $color3; $base-background : $color2; -$link-hover-color: $color4; // Make it equal to either $link-color or false if you don't want - // any effect on links when focused/hovered +// If you don't want any effect on focused/hovered links, +// comment variable below or make it equal to either $link-color or false or null +$link-hover-color: $color4; $brand-primary: $color5; diff --git a/sass/library/_base.scss b/sass/library/_base.scss index cd25ea9..72e9acc 100644 --- a/sass/library/_base.scss +++ b/sass/library/_base.scss @@ -32,11 +32,12 @@ a { // No styling on focus/hover if there's no effect. Avoids to then have to // override it countless times. See Issue #232 - @if ($link-hover-color != $link-color and $link-hover-color != false) { + @if variable_exists(link-hover-color) and + ( null == index( ($link-color, null, false), $link-hover-color) ) { &:focus, &:hover, &:active { - color: $link-hover-color; + color: $link-hover-color; } } }