From: Greg Burri Date: Thu, 10 Sep 2020 17:32:31 +0000 (+0200) Subject: CSS -> SASS X-Git-Url: http://git.euphorik.ch/index.cgi?a=commitdiff_plain;h=a44ff4555b6f08fce20f95ab4fae370012caa0aa;p=rup.git CSS -> SASS --- diff --git a/.gitignore b/.gitignore index c41e4eb..e97304b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ **/*.rs.bk key.secret WebSharper/key +backend/static/style.css +style.css.map \ No newline at end of file diff --git a/backend/build.rs b/backend/build.rs new file mode 100644 index 0000000..ba5da7e --- /dev/null +++ b/backend/build.rs @@ -0,0 +1,25 @@ +/* +Additionnal build, doc: https://doc.rust-lang.org/cargo/reference/build-scripts.html + +What is build here: + - Compile the SASS file to CSS file. +*/ + +use std::process::Command; + +fn main() { + println!("cargo:rerun-if-changed=style.scss"); + + let output = + Command::new("sass") + .arg("./style.scss") + .arg("./static/style.css") + .output() + .expect("Unable to compile SASS file, install SASS, see https://sass-lang.com/"); + + if !output.status.success() { + //panic!("Unable to compile SASS file, install SASS, see https://sass-lang.com/") + let error = std::fs::read_to_string("./static/style.css").expect("unable to read style.css"); + panic!(error); + } +} diff --git a/backend/conf.ron b/backend/conf.ron new file mode 100644 index 0000000..8e0926d --- /dev/null +++ b/backend/conf.ron @@ -0,0 +1,3 @@ +( + port: 8082, +) \ No newline at end of file diff --git a/backend/static/style.css b/backend/static/style.css deleted file mode 100644 index 6fad26a..0000000 --- a/backend/static/style.css +++ /dev/null @@ -1,20 +0,0 @@ -* { - margin: 50px; - padding: 0px; -} - -body { - font-size: 18px; - font-family: 'Lobster Two'; - text-shadow: 2px 2px 2px #DDD; - text-align: center; - line-height: 30px; - color: #5b5b5b; - background-color: #ededed; - margin: 0px; -} - -img { - border: 0px; -} - diff --git a/backend/style.scss b/backend/style.scss new file mode 100644 index 0000000..6fad26a --- /dev/null +++ b/backend/style.scss @@ -0,0 +1,20 @@ +* { + margin: 50px; + padding: 0px; +} + +body { + font-size: 18px; + font-family: 'Lobster Two'; + text-shadow: 2px 2px 2px #DDD; + text-align: center; + line-height: 30px; + color: #5b5b5b; + background-color: #ededed; + margin: 0px; +} + +img { + border: 0px; +} + diff --git a/conf.ron b/conf.ron deleted file mode 100644 index 8e0926d..0000000 --- a/conf.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - port: 8082, -) \ No newline at end of file