From b02882d1d586dbc481a4c002e6e9a5892daabc9f Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 20 Apr 2025 09:16:35 +0300 Subject: Expose custom CSS as a route 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 --- src/database/settings.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/database/settings.rs') 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) + } +} -- cgit 1.4.1