diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-25 15:01:38 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-25 15:01:38 +0100 |
| commit | 5075aede44cb8ab2df10e6debba38483e8d11e96 (patch) | |
| tree | f719e4b4a0c29f3a27b4fa7cf0a6ee6f7739125c /ui | |
| parent | 53361f4c6027d1569a707ce58889bc2c2ea3749c (diff) | |
| download | jellything-5075aede44cb8ab2df10e6debba38483e8d11e96.tar jellything-5075aede44cb8ab2df10e6debba38483e8d11e96.tar.bz2 jellything-5075aede44cb8ab2df10e6debba38483e8d11e96.tar.zst | |
remove some unused imports; css reload; port login logic
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/client-style/Cargo.toml | 7 | ||||
| -rw-r--r-- | ui/client-style/src/lib.rs | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ui/client-style/Cargo.toml b/ui/client-style/Cargo.toml index a5db904..935c525 100644 --- a/ui/client-style/Cargo.toml +++ b/ui/client-style/Cargo.toml @@ -3,5 +3,12 @@ name = "jellyui-client-style" version = "0.1.0" edition = "2024" +[dependencies] +glob = { version = "0.3.3", optional = true } + [build-dependencies] glob = "0.3.3" + +[features] +# default = ["reload"] +reload = ["dep:glob"] diff --git a/ui/client-style/src/lib.rs b/ui/client-style/src/lib.rs index 06ddce4..f0c99cf 100644 --- a/ui/client-style/src/lib.rs +++ b/ui/client-style/src/lib.rs @@ -5,6 +5,19 @@ */ 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) +} |