diff options
author | Vika <vika@fireburn.ru> | 2025-04-20 09:16:35 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2025-04-20 10:01:04 +0300 |
commit | b02882d1d586dbc481a4c002e6e9a5892daabc9f (patch) | |
tree | 194b30281834c536493b23a09344f3ef3e98ac11 /src/database | |
parent | 3207c8ea57eac714417494e06ce0f82864b7ff1e (diff) | |
download | kittybox-b02882d1d586dbc481a4c002e6e9a5892daabc9f.tar.zst |
Expose custom CSS as a route feature/themes
The admin dashboard (that's not done yet) should include methods for setting this field. For now, it could very well be set through editing the database manually. #ManualUntilItHurts Change-Id: Ibef6fca5f1d19f237e660bf3a13b4d72c8c08a0a
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/settings.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/database/settings.rs b/src/database/settings.rs index 77e5821..46346cc 100644 --- a/src/database/settings.rs +++ b/src/database/settings.rs @@ -80,3 +80,20 @@ impl Setting for Theme { Self(data) } } + +#[derive(Debug, Default, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq)] +/// Custom stylesheet for Kittybox, activated by setting the theme to [`ThemeName::Custom`]. +pub struct CustomCss(String); +impl private::Sealed for CustomCss {} +impl Setting for CustomCss { + type Data = String; + const ID: &'static str = "custom_css"; + + fn into_inner(self) -> String { + self.0 + } + + fn new(data: Self::Data) -> Self { + Self(data) + } +} |