aboutsummaryrefslogtreecommitdiff
path: root/server/src/frontend/style/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-01-16 12:20:26 +0100
committermetamuffin <metamuffin@disroot.org>2023-01-16 12:20:26 +0100
commit56cf07697695dea747b1c62768999e6237c55448 (patch)
tree0317c63aa9f4af1811f324a5f526f05cbe4d6a24 /server/src/frontend/style/mod.rs
parent42a81f199793d7d8a07c848d5956436564caf593 (diff)
parent3a702f3997a0caa54d98ec36ca6606787bce6a5a (diff)
downloadjellything-56cf07697695dea747b1c62768999e6237c55448.tar
jellything-56cf07697695dea747b1c62768999e6237c55448.tar.bz2
jellything-56cf07697695dea747b1c62768999e6237c55448.tar.zst
Merge branch 'tpart-master'
Diffstat (limited to 'server/src/frontend/style/mod.rs')
-rw-r--r--server/src/frontend/style/mod.rs21
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()
+ }
+}