Skip to content

Commit 2815edc

Browse files
Update rustdoc_css_themes.rs to take into account new selectors
1 parent 8f9d93b commit 2815edc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tools/tidy/src/rustdoc_css_themes.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ fn compare_themes<'a>(
7474
(noscript_css_line_number, noscript_css_line),
7575
) in rustdoc_css_lines.zip(noscript_css_lines)
7676
{
77-
if noscript_css_line.starts_with(":root {")
78-
&& rustdoc_css_line.starts_with(&format!(r#":root[data-theme="{name}"] {{"#))
77+
if noscript_css_line.starts_with(":root, :root:not([data-theme]) {")
78+
&& (rustdoc_css_line.starts_with(&format!(r#":root[data-theme="{name}"] {{"#))
79+
|| rustdoc_css_line.starts_with(&format!(
80+
r#":root[data-theme="{name}"], :root:not([data-theme]) {{"#
81+
)))
7982
{
8083
// selectors are different between rustdoc.css and noscript.css
8184
// that's why they both exist: one uses JS, the other uses media queries

0 commit comments

Comments
 (0)