mbcahyono
(Muhlis Cahyono)
23 أبريل 2019، 3:53ص
1
Following up the discussion here:
Some users have been asking about automatic switching between a light and a dark theme. Could this be accomplished with a plugin?
I assume this would need two parts:
a theme component with a javascript switching themes based on local time
a Discourse plugin adding options to the user preferences page:
turn night mode switching on/off, choose nighttime theme, set time nighttime time period
How difficult would it be to code? As in, how much would it cost?
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
24 إعجابًا
مكون سمة رائع. لكن لا يمكنني اختيار نطاق زمني للتفعيل. يبدو أن الحقل مخصص لمنطقة توقيت الولايات المتحدة فقط؟
هل من الممكن إضافة كشف وضع macOS الفاتح/الداكن؟
إعجاب واحد (1)
mbcahyono
(Muhlis Cahyono)
9 ديسمبر 2019، 12:41ص
4
أنا متأكد من أنه الوقت المحلي (للجهاز).
هناك سمة أخرى لذلك:
5 إعجابات
لا يمكنني إدخال وقتي المحلي يدويًا. لا يحدث أي شيء.
mbcahyono:
هناك سمة أخرى لذلك:
شكرًا لك على هذه التلميحة! لقد كانت هذه في إشارات مرجعتي من قبل
للأسف، لا تعمل حاليًا. أحتاج إلى إجراء بعض استكشاف الأخطاء وإصلاحها أولاً…
إعجابَين (2)
jrgong
(jrgong)
17 فبراير 2020، 10:27ص
6
هل يمكن دمج مكون هذا السمة مع هذا المكون؟
Any thoughts about making the bottom smaller? When using additional component, it takes a lot of space in the header. For example I like the dark mode button in this ghost theme at top right:
بهذه الطريقة، يمكن للمستخدمين تجاوز وضع الظلام التلقائي عند الرغبة في ذلك.
إعجاب واحد (1)
mbcahyono
(Muhlis Cahyono)
17 فبراير 2020، 11:52ص
7
نعم، يمكنك ذلك، لكنه قد يؤدي إلى سلوك غير متوقع.
jrgong
(jrgong)
4 أغسطس 2020، 12:28م
8
يبدو أن هذا المكون معطّل. فكلما قمت بتفعيله في إعدادات ملفي الشخصي وأعدت تحميل الصفحة، تختفي علامة الصح في المربع ويعاد تعطيله.
أعتقد أن @pmusaraj يعمل على شيء أكثر أتمتة من هذا.
4 إعجابات
pmusaraj
(Penar Musaraj)
25 أغسطس 2020، 1:48م
10
تتمتع Core الآن بميزة مماثلة تعتمد على واجهة الوضع المظلم الخاصة بالجهاز، يرجى الاطلاع على التبديل التلقائي لنمط الألوان للوضع المظلم .
4 إعجابات