Skip to content

Commit c51f442

Browse files
committed
Forbid empty custom property values
sass-spec: sass/sass-spec#1385 Fixes #2655
1 parent f2db048 commit c51f442

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/expand.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,13 @@ namespace Sass {
253253
if (value) value = value->perform(&eval);
254254
Block_Obj bb = ab ? operator()(ab) : NULL;
255255
if (!bb) {
256-
if (!value || (value->is_invisible() && !d->is_important())) return 0;
256+
if (!value || (value->is_invisible() && !d->is_important())) {
257+
if (d->is_custom_property()) {
258+
error("Custom property values may not be empty.", d->value()->pstate(), traces);
259+
} else {
260+
return nullptr;
261+
}
262+
}
257263
}
258264
Declaration* decl = SASS_MEMORY_NEW(Declaration,
259265
d->pstate(),

src/parser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,7 @@ namespace Sass {
18591859
css_error("Invalid CSS", " after ", message);
18601860
}
18611861

1862-
if (schema->empty()) return {};
1862+
if (schema->empty()) error("Custom property values may not be empty.");
18631863
return schema.detach();
18641864
}
18651865

0 commit comments

Comments
 (0)