diff --git a/ui/build.rs b/ui/build.rs new file mode 100644 index 0000000..20d81b9 --- /dev/null +++ b/ui/build.rs @@ -0,0 +1,20 @@ +// Generates static assets. + +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::Path; + +use sass_rs::{self, Options}; + +fn main() { + let dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + let scss_dir = Path::new(&dir).join("scss"); + let source_css_file = scss_dir.join("stoptime.scss"); + let css_dir = Path::new(&dir).join("static").join("css"); + let target_css_file = css_dir.join("stoptime.css"); + + let sass = sass_rs::compile_file(&source_css_file, Options::default()).unwrap(); + let mut f = File::create(&target_css_file).unwrap(); + f.write_all(sass.as_bytes()).unwrap(); +} diff --git a/ui/scss/stoptime.scss b/ui/scss/stoptime.scss new file mode 100644 index 0000000..c4c4a4e --- /dev/null +++ b/ui/scss/stoptime.scss @@ -0,0 +1,28 @@ +// Include all of Bootstrap. +@import "bootstrap/bootstrap"; + +// Include all of Font Awesome. +@import "fontawesome/fontawesome"; + +/* StopTime's main CSS (overrides) + */ + +// Prepare for the fixed-top navbar. +html { + position: relative; + min-height: 100%; +} + +// Add some padding for the fixed-top navbar. +body { + padding-top: 80px; + margin-bottom: 24px; +} + +footer { + position: absolute; + bottom: 0; + width: 100%; + height: 24px; + line-height: 24px; +} diff --git a/ui/static/css/.gitkeep b/ui/static/css/.gitkeep new file mode 100644 index 0000000..e69de29