diff --git a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp
index cae5183436..44e5b74c39 100644
--- a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp
+++ b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp
@@ -7,6 +7,7 @@
#include
#include
+#include
#include
#include
@@ -102,7 +103,21 @@ void SyntaxHighlighter::rehighlight(Palette const& palette)
spans.extend(proxy_client.corrected_spans());
substring_builder.clear();
} else if (state == State::CSS) {
- // FIXME: Highlight CSS code here instead.
+ Syntax::ProxyHighlighterClient proxy_client {
+ *m_client,
+ substring_start_position,
+ static_cast(AugmentedTokenKind::__Count) + first_free_token_kind_serial_value(),
+ substring_builder.string_view()
+ };
+ {
+ CSS::SyntaxHighlighter highlighter;
+ highlighter.attach(proxy_client);
+ highlighter.rehighlight(palette);
+ highlighter.detach();
+ register_nested_token_pairs(proxy_client.corrected_token_pairs(highlighter.matching_token_pairs()));
+ }
+
+ spans.extend(proxy_client.corrected_spans());
substring_builder.clear();
}
state = State::HTML;