| 36 | generate_userspace(&manifest_dir, &out_dir); |
| 37 | } |
| 38 | |
| 39 | fn generate_theme_palette(manifest_dir: &Path, out_dir: &Path) { |
| 40 | let palette = manifest_dir.join("theme/github-dark.css"); |
| 41 | println!("cargo:rerun-if-changed={}", palette.display()); |
| 42 | let css = fs::read_to_string(&palette).expect("read shared theme palette"); |
| 43 | let mut code = String::from("// @generated from theme/github-dark.css; do not edit.\n"); |
| 44 | let mut colors = 0; |
| 45 | |
| 46 | for line in css.lines() { |
| 47 | let Some((name, value)) = line |
| 48 | .trim() |
| 49 | .strip_prefix("--fs-") |
| 50 | .and_then(|line| line.split_once(':')) |
| 51 | else { |
| 52 | continue; |