aboutsummaryrefslogtreecommitdiff
path: root/ui/client-style/src/lib.rs
blob: f0c99cf2e778d816666bd1edf51dd9ea7c3de3e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2026 metamuffin <metamuffin.org>
*/
use std::borrow::Cow;

#[cfg(not(feature = "reload"))]
pub fn css_bundle() -> Cow<'static, str> {
    include_str!(concat!(env!("OUT_DIR"), "/bundle.css")).into()
}

#[cfg(feature = "reload")]
pub fn css_bundle() -> Cow<'static, str> {
    let mut out = String::new();
    for file in glob::glob("ui/client-style/src/**/*.css")
        .unwrap()
        .map(Result::unwrap)
    {
        out += &std::fs::read_to_string(file).unwrap();
    }
    Cow::Owned(out)
}