Skip to content

Commit

Permalink
Merge pull request #380 from ahti/master
Browse files Browse the repository at this point in the history
client-side color-scheme handling
  • Loading branch information
svenstaro committed Oct 2, 2020
2 parents 2560345 + e58f078 commit 39d7677
Show file tree
Hide file tree
Showing 12 changed files with 1,042 additions and 874 deletions.
108 changes: 107 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Expand Up @@ -55,3 +55,6 @@ rstest = "0.6"
regex = "1.3.9"
pretty_assertions = "0.6"
url = "2.1"

[build-dependencies]
grass = "0.10.3"
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -106,8 +106,11 @@ Sometimes this is just a more practical and quick way than doing things properly
username:sha512:hash (e.g. joe:123,
joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3)
-c, --color-scheme <color-scheme>
Default color scheme [default: Squirrel] [possible values: Archlinux, Zenburn,
Monokai, Squirrel]
Default color scheme [default: squirrel] [possible values: squirrel, archlinux, zenburn, monokai]

-d, --color-scheme-dark <color-scheme-dark>
Default color scheme [default: archlinux] [possible values: squirrel, archlinux, zenburn, monokai]

--index <index_file>
The name of a directory index file to serve, like "index.html"

Expand Down
19 changes: 19 additions & 0 deletions build.rs
@@ -0,0 +1,19 @@
use std::env;
use std::fs;
use std::path::Path;

fn main() {
let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR env var missing");
let dest_path = Path::new(&out_dir).join("style.css");
fs::write(
&dest_path,
grass::from_string(
include_str!("data/style.scss").to_string(),
&grass::Options::default(),
)
.expect("scss failed to compile"),
)
.expect("failed to write css file");

println!("cargo:rerun-if-changed=data/style.scss");
}

0 comments on commit 39d7677

Please sign in to comment.