Skip to content

Commit 1da2e58

Browse files
committed
fix: fix use css vars with initial.
1 parent 6906a12 commit 1da2e58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

webf/lib/src/css/values/variable.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ class CSSVariable {
4747

4848
// Get the lazy calculated CSS resolved value.
4949
dynamic computedValue(String propertyName) {
50-
dynamic value = _renderStyle.getCSSVariable(identifier, propertyName) ?? defaultValue;
50+
dynamic value = _renderStyle.getCSSVariable(identifier, propertyName);
51+
if (value == null || value == INITIAL) {
52+
value = defaultValue;
53+
}
54+
5155
if (value == null) {
5256
return null;
5357
}

0 commit comments

Comments
 (0)