Skip to content

Commit

Permalink
Update rustdoc_css_themes.rs to take into account new selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Apr 3, 2024
1 parent 8f9d93b commit 2815edc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tools/tidy/src/rustdoc_css_themes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ fn compare_themes<'a>(
(noscript_css_line_number, noscript_css_line),
) in rustdoc_css_lines.zip(noscript_css_lines)
{
if noscript_css_line.starts_with(":root {")
&& rustdoc_css_line.starts_with(&format!(r#":root[data-theme="{name}"] {{"#))
if noscript_css_line.starts_with(":root, :root:not([data-theme]) {")
&& (rustdoc_css_line.starts_with(&format!(r#":root[data-theme="{name}"] {{"#))
|| rustdoc_css_line.starts_with(&format!(
r#":root[data-theme="{name}"], :root:not([data-theme]) {{"#
)))
{
// selectors are different between rustdoc.css and noscript.css
// that's why they both exist: one uses JS, the other uses media queries
Expand Down

0 comments on commit 2815edc

Please sign in to comment.