blob: ca54aa7c79fad5833c861dc74e563b14f854df36 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
use std::{
fs::{read_to_string, File},
io::Read,
};
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()
}
}
|