Skip to content

Commit 0dc9599

Browse files
committed
Improved background handling
1 parent 78d67ab commit 0dc9599

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/AngleSharp.Css/Declarations/BackgroundDeclaration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public ICssValue Convert(StringSource source)
124124
clip));
125125
}
126126

127-
return new CssBackgroundValue(new CssListValue(layers.OfType<ICssValue>().ToArray()), color);
127+
return new CssBackgroundValue(new CssListValue(layers.OfType<ICssValue>().ToArray()), color ?? new CssInitialValue(InitialValues.BackgroundColorDecl));
128128
}
129129

130130
public ICssValue Merge(ICssValue[] values)

src/AngleSharp.Css/Values/Composites/CssBackgroundValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public String CssText
4343
{
4444
var layer = _layers.CssText;
4545

46-
if (_color != null)
46+
if (_color != null && _color is CssInitialValue == false)
4747
{
4848
var sep = layer.Length > 0 ? " " : "";
4949
var color = _color.CssText;

0 commit comments

Comments
 (0)