Skip to content

Commit 6f8d41c

Browse files
Rollup merge of #101813 - GuillaumeGomez:check-css-variables, r=notriddle
Extend CSS check to CSS variables This PR is a bit big because the first commit is a rewrite of the CSS parser to something a bit simpler which still allows to get easily access to CSS properties name. The other two are about adding tests and adding the CSS variables check. This check was missing because we are relying more and more on CSS variables rather than CSS selectors in themes. r? `@notriddle`
2 parents e96abef + d3529ce commit 6f8d41c

File tree

3 files changed

+296
-233
lines changed

3 files changed

+296
-233
lines changed

src/librustdoc/config.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,13 @@ impl Options {
412412

413413
let to_check = matches.opt_strs("check-theme");
414414
if !to_check.is_empty() {
415-
let paths = theme::load_css_paths(static_files::themes::LIGHT.as_bytes());
415+
let paths = match theme::load_css_paths(static_files::themes::LIGHT) {
416+
Ok(p) => p,
417+
Err(e) => {
418+
diag.struct_err(&e.to_string()).emit();
419+
return Err(1);
420+
}
421+
};
416422
let mut errors = 0;
417423

418424
println!("rustdoc: [check-theme] Starting tests! (Ignoring all other arguments)");
@@ -547,7 +553,13 @@ impl Options {
547553

548554
let mut themes = Vec::new();
549555
if matches.opt_present("theme") {
550-
let paths = theme::load_css_paths(static_files::themes::LIGHT.as_bytes());
556+
let paths = match theme::load_css_paths(static_files::themes::LIGHT) {
557+
Ok(p) => p,
558+
Err(e) => {
559+
diag.struct_err(&e.to_string()).emit();
560+
return Err(1);
561+
}
562+
};
551563

552564
for (theme_file, theme_s) in
553565
matches.opt_strs("theme").iter().map(|s| (PathBuf::from(&s), s.to_owned()))

0 commit comments

Comments
 (0)