Theme Switcher Component

Unless @B-iggy can add an option to choose location? :smiley:

It’s not easy indeed.
If you mean something like this I can maybe try to merge it somehow.

I did not test it with every theme but let me know if something breaks.

What do you mean with bottom? This theme switcher component is rather horizontally align. Do you mean to reduce the width?

Replacing the logo based on toggling light or dark mode is not so easy and would require more options. I’ll note it down, maybe for the future.

2 个赞

My idea was in the panel menu (not the user panel menu):

Sorry it must have been a typo. I meant button :smiley: The link to the liebling theme was an example for alternative button

You don’t necessarily need to replace the logo. Maybe just using a fa-icon switching colors and box-shadow via CSS should do the job.

1 个赞

It would be best to use this component : Hamburger Theme Selector - #63 by sam

It’s not a switch but what you’re asking might need too much work.

1 个赞

Hi,

Thank you for your component.

I wish this component had the translation support.

Hey @B-iggy thank you for this component!

I got a little confused on how I’m setting the two themes I’m gonna toggle between.
I have the classic “Light” and “Dark” theme and added both on the theme switcher.
When I toggle though it switches to alien theme and not the dark that I’d like to :thinking:

Is there a way to make it use only these two themes that I want?

Thank you for your time and contribution :rocket:

2 个赞

Hey @akapetzoglou1
wow, time is passing by crazy this year. Sorry for the delay. Currently struggling with certain things, hence contributing to Discourse unfortunately falls off.

It is not meant to toggle whole themes. Only a predefined dark and light one, I have configured in the CSS.
I think there is a theme switcher out there, that does what you want.
At least, if I understand it correctly.

3 个赞

Hey @B-iggy

is there any way to use the component to toggle between two color schemes
Now that there is a setting in the user profile for a dark mode, it would be neat to be able to toggle between the regular and the dark one.

3 个赞

Hey Sir I am using this theme component But after using it in classic default theme when i switch to dark mode The admin panel looks like this

All text Goes invisible
i have tried changing secondary color but if i change that it Changes Full theme background also Changes Which i don’t want i only want to change secondary text color so it is visible
Please if u have any solutions share it plz

Air Theme 中有一个主题切换器组件。但是,按钮在汉堡菜单中。有谁有能力并且有时间将 discourse-color-scheme-toggle 与主题切换器组件集成,并在标题中添加一个按钮,以便在浅色和深色主题之间快速切换?

2 个赞

我也很想。我曾试图挤出一些时间来弄清楚,但还没有弄明白!
我已经实现了你链接的那个,但我希望有一个显而易见的标题切换。

1 个赞

此主题组件存在 bug,如果用户在其设备上开启了深色模式,并在论坛中开启了浅色模式,则 logo 不会改变,用户会看到浅色 logo(用于深色模式)在浅色模式下显示。

此主题组件无法与侧边栏配合使用,是否有计划支持它?感谢您的考虑以及已有的成果!

1 个赞

大家好,

过去几个月我一直很忙,但我真的很想再次给这个组件多一点关注 :slight_smile: 我会尝试看看 Discourse 的所有最新更改需要多少工作量,并在稍后在此处发布更新。

3 个赞

经过对我的 Alien Night Theme 进行重构后,我意识到这个组件不再有太大意义了。

“深色/浅色切换”组件正是我想用这个组件做的,而且做得更好。
从长远来看,我使用大量类并进行调整的方法是不可持续的。
相反,下面的组件只是获取你的两个配色方案并翻转正确的 CSS 变量:

它目前似乎坏了(但在我的 Alien Night Theme 中可以正常工作),但将来请使用它。

我现在将我的组件设置为“旧版/已弃用”。

1 个赞