aboutsummaryrefslogtreecommitdiff
path: root/server/src/frontend/style/mod.rs
blob: 1e51d100c3d83ef4b81e92f3c8879212cd07d829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::{fs::{File, read_to_string}, 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()
    }
}