مكون الوضع الليلي التلقائي

Following up the discussion here:

I made a theme component that will automatically switch to night theme based on user preferences. It’s currently work on a per-browser basis.

Repository

https://github.com/muhlisbc/discourse-automatic-night-mode-theme

Screenshot:

Installation

Add this component to each theme installed.

Known Issues

  • I’ve received a report of the component making all navigation cause full reloads. Upon navigating between different pages every click caused a full refresh instead of an in-app navigation. I have not been able to reproduce this, so please post reproduction steps if you run into this.

Feedback is welcome and thanks to Discourse team for sponsoring this work :slight_smile:

24 إعجابًا

Nice theme component. But I can’t choose a time range for activation. It seems the field is for US time zones only?

Is it possible to add macOS Light/Dark mode detection?

إعجاب واحد (1)

I’m sure it’s local (device) time.

There is another theme for that:

5 إعجابات

I can’t enter my local time manually. Nothing happens.

Thanks for this hint! I’ve had this in my bookmarks before :see_no_evil:

Unfortunately, it doesn’t work right now. I need to some troubleshooting first…

إعجابَين (2)

Can this theme component be combined with this one?

That way users could override the automatic dark mode, when desired

إعجاب واحد (1)

Yes, you can but it might lead to unexpected behavior.

يبدو أن هذا المكون معطّل. فكلما قمت بتفعيله في إعدادات ملفي الشخصي وأعدت تحميل الصفحة، تختفي علامة الصح في المربع ويعاد تعطيله.

أعتقد أن @pmusaraj يعمل على شيء أكثر أتمتة من هذا.

4 إعجابات

تتمتع Core الآن بميزة مماثلة تعتمد على واجهة الوضع المظلم الخاصة بالجهاز، يرجى الاطلاع على التبديل التلقائي لنمط الألوان للوضع المظلم.

4 إعجابات