Skip to content

Commit cb19e8f

Browse files
committed
Don't consider hex colour values of length 4 or 8 as invalid
Hex colours can be 3, 4, 6 or 8 characters in length which is already handled in Color.FromHex but ColorToken.IsValid was only considering lengths 3 and 6 as valid and so these hex colours would get rejected
1 parent 0224e07 commit cb19e8f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ExCSS/Tokens/ColorToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public ColorToken(string data, TextPosition position)
77
{
88
}
99

10-
public bool IsValid => Data.Length != 3 && Data.Length != 6;
10+
public bool IsValid => Data.Length != 3 && Data.Length != 4 && Data.Length != 6 && Data.Length != 8;
1111

1212
public override string ToValue()
1313
{

0 commit comments

Comments
 (0)