-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use std::env::current_dir; | ||
use std::fs::File; | ||
use std::io::Read; | ||
use std::path::Path; | ||
use build_const::{src_file, ConstWriter}; | ||
use css_minify::optimizations::{Level, Minifier}; | ||
|
||
fn main() { | ||
let main = src_file!("styles.rs"); | ||
let consts = ConstWriter::from_path(Path::new(main)).unwrap(); | ||
let mut consts = consts.finish_dependencies(); | ||
let mut file = File::open(current_dir().unwrap().join("static/main.css")).unwrap(); | ||
let mut styles = String::new(); | ||
file.read_to_string(&mut styles).unwrap(); | ||
consts.add_value("STYLES", "&str", Minifier::default().minify(styles.as_str(), Level::Three).unwrap()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub const STYLES: &str = "html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0;font-family:'Oswald',sans-serif}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font:1em monospace,monospace}a{background:transparent}abbr[title]{border-bottom:none;text-decoration:underline dotted}b,strong{font-weight:700er}code,kbd,samp{font:1em monospace,monospace}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border:none}button,input,optgroup,select,textarea{margin:0;font:100%/1.15 inherit}button,input{overflow:visible}button,select{text-transform:none}[type=\"button\"],[type=\"reset\"],[type=\"submit\"],button{-webkit-appearance:button}[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner ,button::-moz-focus-inner{border:none;padding:0}[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring ,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button {height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px}[type=\"search\"]::-webkit-search-decoration {-webkit-appearance:none}::-webkit-file-upload-button {-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.header{display:flex;justify-content:space-around;align-items:center;padding:1rem 0;background:#bdbdbd}.nav{display:flex}.brand{margin-right:1rem;font-size:20px;font-weight:700;text-decoration:none;color:#000}.main{background:#efefef}.container{width:100%;margin:0 auto;padding:20px 0}.heading{padding:1rem 0;margin:0}.columns{display:grid;grid-template-columns:1fr}.column{padding:10px 20px}.textarea{width:100%;border:none;min-width:50%;font:14px/16px 'Oswald',monospace;box-sizing:border-box;padding:16px}textarea:focus {outline:none;box-shadow:0 13px 38px 0 #212121}textarea:disabled {border:1px solid #212121;border-radius:10px}.code-block{background:#212121;color:#fafafa;padding:20px;max-width:100%;white-space:pre-wrap}.footer{padding:10px;display:flex;justify-content:center;align-items:center;background:#8c8c8c}.link{color:black;text-decoration:none}.submit{background:#212121;color:#fafafa;border:none;padding:15px 32px;text-align:center;text-decoration:none;font-size:16px;cursor:pointer;margin:10px 0}.options{display:flex;justify-content:space-between;align-items:flex-start;flex-direction:column}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}.options{flex-direction:row;align-items:center}.submit{margin:0}}@media (min-width:992px){.container{max-width:960px}.columns{grid-template-columns:1fr 1fr}}@media (min-width:1200px){.container{max-width:1200px}}"; |