From d3bdbfb00450b43955310f70154f6ea41903e298 Mon Sep 17 00:00:00 2001 From: riaan Date: Thu, 8 Jul 2021 15:51:45 +0200 Subject: [PATCH] Better SASS implementation Updated the SASS variables names for better project integration and variables !default to support variable overwrites --- sass/_countries.scss | 4 ++-- sass/_extras.scss | 4 ++-- sass/_variables.scss | 4 ++-- sass/flag-icons.scss | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sass/_countries.scss b/sass/_countries.scss index 6889912..a5713aa 100644 --- a/sass/_countries.scss +++ b/sass/_countries.scss @@ -1,4 +1,4 @@ -$countries: ( +$flag-icons-countries: ( 'AD' 'AE' 'AF' @@ -253,4 +253,4 @@ $countries: ( 'ZA' 'ZM' 'ZW' -); +) !default; \ No newline at end of file diff --git a/sass/_extras.scss b/sass/_extras.scss index 0981346..8a22cb7 100644 --- a/sass/_extras.scss +++ b/sass/_extras.scss @@ -1,4 +1,4 @@ -$extras: ( +$flag-icons-extras: ( 'CAF' 'CAS' 'CNA' @@ -7,4 +7,4 @@ $extras: ( 'EU' 'WW' 'LGBT' -); +) !default; \ No newline at end of file diff --git a/sass/_variables.scss b/sass/_variables.scss index a8e303c..1e7df40 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -2,7 +2,7 @@ @import "countries"; // Change or use as your needs. -$path: '../svg' !default; +$flag-icons-path: '../svg' !default; // Load'em all! -$flags: join($extras, $countries, comma); +$flag-icons-flags: join($flag-icons-extras, $flag-icons-countries, comma) !default; diff --git a/sass/flag-icons.scss b/sass/flag-icons.scss index 63aba89..6bd663a 100644 --- a/sass/flag-icons.scss +++ b/sass/flag-icons.scss @@ -27,9 +27,9 @@ span, i { } // Flags - @each $flag in $flags { + @each $flag in $flag-icons-flags { &.#{$flag} { - background-image: url(#{$path}/#{$flag}.svg); + background-image: url(#{$flag-icons-path}/#{$flag}.svg); } } }