/*
    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)
}
