Skip to content

Commit d270a9c

Browse files
committed
Prevent issues with quoting values that might not be strings.
1 parent dacbf93 commit d270a9c

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"strapless"
1010
],
1111
"homepage": "https://www.github.com/deviscoding/colors",
12-
"version": "1.0.9",
12+
"version": "1.0.10",
1313
"replace": {
1414
"strapless/colors": "^1.0"
1515
},

scss/_colors-functions.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
@return $color-name;
2727
}
2828

29+
@if type-of($color-name) == number {
30+
$color-name: inspect($color-name);
31+
}
32+
2933
// Force Quotes to Match Map
3034
$color-name: quote($color-name);
3135

@@ -126,7 +130,12 @@
126130
// region ////////////////////////////////////////////// Other Color Functions
127131

128132
@function isLight($color, $threshold: 150) {
129-
@if quote($color) == "transparent" {
133+
@if type-of($color) == "string" {
134+
@if quote($color) == "transparent" {
135+
@return true;
136+
}
137+
}
138+
@if $color == "transparent" {
130139
@return true;
131140
} @else {
132141
$red: red($color);

0 commit comments

Comments
 (0)