Add custom theming support#1518
Conversation
|
I'm definitely not opposed to the idea, but for something like this I would like to keep everything on the UI side. slskd was created from the start to support different UIs, swappable by changing the path to the static content (or just overwriting it on disk) and I want to steer clear of anything that will too closely relate to one UI on the backend so things don't get confusing. I think to fix this up all that is needed is to move the themes to the public directory in the UI and then store the theme somewhere in local storage There's a lot of stuff blocked on UI options/preferences, and I think the easy answer there is to just leverage local storage with whatever approach makes sense. It's not ideal that preferences won't be applied across devices but it's more ideal than any of the alternatives |
|
Ok so like a user would just put the theme into the public directory or mount with docker. I like that actually. It's pretty jank to serve a stylesheet like this. |
|
Ok I modified it so the user would just put the theme.css in their public dir. Pretty easy to just change where we load the file from and this solution serves it in a more optimized way. |
|
Hi @jpdillingham, Checking back in on this PR. I see that I have changed the architecture such that the backend doesn't serve the theme through API, the user just has to put it into the public dir to be served as a static asset. This adheres to your design principle of swappable UIs because the backend is unchanged and has no new responsibilities. Is there any further modification necessary or testing that you would like me to perform? |
|
I will take a look this weekend. The CSS files can be dropped in |
That makes sense. Currently it's hardcoded to theme.css in public (initializing defaults if not present), but a ui driven toggle could be a better solution for users that want to flip between styles. I'll give it some thought as well. |
|
2026-03-29-css-theme-switching-design.md I took some time with the superpowers Claude plugin to flesh this idea out more and figured I spent the tokens so I might as well share the markdown it produced. Curious your thoughts. tl;dr this would put the theme css and a manifest in |
Add custom theming support
Description
Adds the ability for theming though custom css file. A number of themes are provided in the docs. This is achieved by adding a configurable file that I can serve on endpoint and then load into the app.
Changes
custom_css_pathconfigurable optiondocs/themesdocs/config.mdto explain how theming worksJustification