diff options
author | tpart <10518520-tpart@users.noreply.gitlab.com> | 2023-01-15 12:38:42 +0100 |
---|---|---|
committer | tpart <10518520-tpart@users.noreply.gitlab.com> | 2023-01-15 12:38:42 +0100 |
commit | 85abefbc5668d42c0d23735a4ce157ee8659c88b (patch) | |
tree | 4208c3aa8fc1b0404b41c22cf730101ab23291a5 /server/src/frontend/style/mod.rs | |
parent | e3f1a8ac9f4c9a015e9eac769fb3262e3bd16bad (diff) | |
download | jellything-85abefbc5668d42c0d23735a4ce157ee8659c88b.tar jellything-85abefbc5668d42c0d23735a4ce157ee8659c88b.tar.bz2 jellything-85abefbc5668d42c0d23735a4ce157ee8659c88b.tar.zst |
Use cantarell font
Diffstat (limited to 'server/src/frontend/style/mod.rs')
-rw-r--r-- | server/src/frontend/style/mod.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/server/src/frontend/style/mod.rs b/server/src/frontend/style/mod.rs index 9d0729e..1e51d10 100644 --- a/server/src/frontend/style/mod.rs +++ b/server/src/frontend/style/mod.rs @@ -1,2 +1,21 @@ +use std::{fs::{File, read_to_string}, io::Read}; -pub const CSS_BUNDLE: &'static str = include_str!("layout.css"); + + +pub fn css_bundle() -> String { + if cfg!(debug_assertions) { + read_to_string("server/src/frontend/style/layout.css").unwrap() + } else { + include_str!("layout.css").to_string() + } +} + +pub fn font_bundle() -> Vec<u8> { + if cfg!(debug_assertions) { + let mut woff = Vec::new(); + File::open("server/src/frontend/style/cantarell.woff2").unwrap().read_to_end(&mut woff).unwrap(); + woff + } else { + include_bytes!("cantarell.woff2").to_vec() + } +} |