We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1976c6d commit 15b2a10Copy full SHA for 15b2a10
pkg/_pub_shared/lib/validation/html/html_validation.dart
@@ -192,6 +192,16 @@ void validateHtml(Node root) {
192
throw AssertionError(
193
'<$tag> tag should not have role attribute, found: ${elem.outerHtml}');
194
}
195
+
196
+ // body always has one of the theme classes
197
+ final body = querySelectorAll('body').singleOrNull;
198
+ if (body != null) {
199
+ final classes = body.classes.toSet();
200
+ if (!classes.contains('light-theme') && !classes.contains('dark-theme')) {
201
+ throw AssertionError(
202
+ '<body> must contain either `light-theme` or `dark-theme`');
203
+ }
204
205
206
207
/// "Google Search result usually points to the canonical page, unless one of
0 commit comments