mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-03 07:24:59 -05:00
feat: Add CSS classes to elements for custom themes #206
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SethBurkart123 on GitHub (Jan 18, 2024).
Is your feature request related to a problem? Please describe.
The current implementation of themes requires complex css selectors that will break as soon as the base styles are modified making them extremely hard to maintain. eg. the current rose-pine theme uses selectors such as:
In order to change simple properties. If styling got changed in the base, these selectors would instantly be invalidated and break the theme.
Describe the solution you'd like
I propose that to all important elements that should be possible to select with css there should either be accessibility attributes, id's or classes added so that it's a whole lot easier to create and maintain alternative themes.
I'm open to create a fix for this myself with a pull request if people are interested.
@r-darwish commented on GitHub (May 22, 2024):
I just tried my luck in fixing the rose theme but it's very hard due to the reason that you stated. It also makes it practially impossible to create new themes. Are you suggesting to add some more simple classes that can be selected by all themes? I have very few experience with frontend engineering so I'm not sure what's the correct way to fix this problem.
@justinh-rahb commented on GitHub (May 22, 2024):
I'm not much for frontend either, but I believe that's at least in the right direction. You could maybe research if there's some well-known methods or well-supported libraries in Svelte to help with this.
@SethBurkart123 commented on GitHub (May 23, 2024):
Yeah, I mean all you need to do is attach classes or id's etc. so that elements can be selected. TailwindCSS is great, but by nature isn't good for writing overrides after the site's been built. So you just need to manually add CSS selectable identification on all the different elements, eg. you might give the sidebar the class
sidebarthe thing is it doesn't have to be complicated, and these classes by default don't even need to do anything... There isn't much you can do other than that.