Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/stylus
diff options
context:
space:
mode:
authorMartijn Cuppens <martijn.cuppens@intracto.com>2018-12-07 00:31:57 +0300
committerMartijn Cuppens <martijn.cuppens@intracto.com>2018-12-07 00:31:57 +0300
commitb0e71321a99b952f2eb4c82fe10edcfed8cbcb25 (patch)
tree6c4ea1784c191cb4d866e1971900eb29104f75f0 /stylus
parent58facdc9adfdb75c392dacc53ab84960a9a1e5df (diff)
Warn if rfs is imported more than once
Diffstat (limited to 'stylus')
-rw-r--r--stylus/rfs.styl10
1 files changed, 10 insertions, 0 deletions
diff --git a/stylus/rfs.styl b/stylus/rfs.styl
index 8e15945..00b48ab 100644
--- a/stylus/rfs.styl
+++ b/stylus/rfs.styl
@@ -49,6 +49,9 @@ $rfs-breakpoint-unit = unit($rfs-breakpoint)
// Remove unit from $rfs-breakpoint for calculations
if $rfs-breakpoint-unit == "px"
$rfs-breakpoint = unit($rfs-breakpoint, "")
+else if $rfs-breakpoint-unit == ""
+ // Use `px` as default
+ $rfs-breakpoint-unit = "px"
else if $rfs-breakpoint-unit == "rem" or $rfs-breakpoint-unit == "em"
$rfs-breakpoint = unit($rfs-breakpoint * $rfs-rem-value, "")
@@ -172,3 +175,10 @@ rfs($fs, $important = false)
// The responsive-font-size mixin uses RFS to rescale font sizes
responsive-font-size($fs, $important = false)
rfs($fs, $important)
+
+$rfs-is-included ?= false
+
+if $rfs-is-included
+ warn("Watch out, RFS is included more than once!")
+
+$rfs-is-included = true