Skip to content

Commit 396d968

Browse files
authored
messy none (#705)
1 parent e5093ef commit 396d968

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/style.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ export function styles(
6767
const [vopacity, copacity] = maybeNumberChannel(opacity);
6868

6969
// For styles that have no effect if there is no stroke, only apply the
70-
// defaults if the stroke is not (constant) none.
70+
// defaults if the stroke is not the constant none. (If stroke is a channel,
71+
// then cstroke will be undefined, but there’s still a stroke; hence we don’t
72+
// use the none helper here.)
7173
if (cstroke !== "none") {
7274
if (strokeWidth === undefined) strokeWidth = defaultStrokeWidth;
7375
if (strokeLinecap === undefined) strokeLinecap = defaultStrokeLinecap;
@@ -207,7 +209,7 @@ export function impliedNumber(value, impliedValue) {
207209
}
208210

209211
export function none(color) {
210-
return color == null || color === "none";
212+
return color == null || /^\s*none\s*$/i.test(color);
211213
}
212214

213215
const validClassName = /^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/;

0 commit comments

Comments
 (0)