diff --git a/Tests/LibWeb/Text/expected/css/font-family-with-dash-prefix.txt b/Tests/LibWeb/Text/expected/css/font-family-with-dash-prefix.txt
new file mode 100644
index 00000000000000..5053d71f0cdd89
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/css/font-family-with-dash-prefix.txt
@@ -0,0 +1 @@
+serif, -apple-system
diff --git a/Tests/LibWeb/Text/input/css/font-family-with-dash-prefix.html b/Tests/LibWeb/Text/input/css/font-family-with-dash-prefix.html
new file mode 100644
index 00000000000000..84d10f3a1dc57b
--- /dev/null
+++ b/Tests/LibWeb/Text/input/css/font-family-with-dash-prefix.html
@@ -0,0 +1,9 @@
+
+
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
index 37bf764172096c..92744672b0776a 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
@@ -7928,6 +7928,7 @@ Parser::ParseErrorOr> Parser::parse_css_value(Property
m_context.set_current_property_id(property_id);
Vector component_values;
bool contains_var_or_attr = false;
+ bool const property_accepts_custom_ident = property_accepts_type(property_id, ValueType::CustomIdent);
while (tokens.has_next_token()) {
auto const& token = tokens.next_token();
@@ -7941,7 +7942,7 @@ Parser::ParseErrorOr> Parser::parse_css_value(Property
if (token.is(Token::Type::Whitespace))
continue;
- if (token.is(Token::Type::Ident) && has_ignored_vendor_prefix(token.token().ident()))
+ if (!property_accepts_custom_ident && token.is(Token::Type::Ident) && has_ignored_vendor_prefix(token.token().ident()))
return ParseError::IncludesIgnoredVendorPrefix;
}
diff --git a/Userland/Libraries/LibWeb/CSS/Properties.json b/Userland/Libraries/LibWeb/CSS/Properties.json
index 931c19a7c65f78..363a233352b25e 100644
--- a/Userland/Libraries/LibWeb/CSS/Properties.json
+++ b/Userland/Libraries/LibWeb/CSS/Properties.json
@@ -851,7 +851,11 @@
},
"font-family": {
"inherited": true,
- "initial": "sans-serif"
+ "initial": "sans-serif",
+ "valid-types": [
+ "custom-ident",
+ "string"
+ ]
},
"font-size": {
"inherited": true,