هل هناك أيضاً إمكانية لتحميل نوعين من الشعارات للفئات واختيار الشعار المناسب حسب سمة Discourse (Discourse Theme) المحددة. على سبيل المثال:
السمة الفاتحة (Light Theme): شعار أسود
السمة الداكنة (Dark Theme): شعار أبيض
شكراً لك!
إعجاب واحد (1)
david
(David Taylor)
30 مارس 2022، 8:29ص
2
لا أعتقد أن لدينا شيئًا كهذا مدمجًا في الوقت الحالي. ومع ذلك، قد يكون ذلك ممكنًا عبر مكون سمة.
لقد نقلت هذا السؤال إلى موضوعه الخاص حتى يحظى بمزيد من الاهتمام - ربما يكون شخص آخر قد حل هذه المشكلة في الماضي
إعجاب واحد (1)
pmusaraj
(Penar Musaraj)
7 أكتوبر 2022، 3:29م
3
بفضل @jancernik ، أصبح هذا الآن ميزة أساسية. مثل شعار الموقع، يمكنك الآن تحميل شعارات داكنة للفئات، وسيتم استخدامها عند استخدام الوضع الداكن.
main ← jancernik:dark-mode-for-categories-logos
opened 07:03PM - 03 Oct 22 UTC
@pmusaraj suggested I open this draft because while working on this feature, I r… an into a problem I need help with.
As far as I know, the feature "works", and the icons change depending on the theme as expected.
The problem I have is the `style="--aspect-ratio"` attribute applied to the parent div of the logo.
This attribute was originally defined inside `cdn-img`, but since I had to use that component inside a picture tag, I had to move it to `category-logo`. It is also applied through the following code inside `category-logo.js` (this is the part I don't fully understand):
```javascript
@discourseComputed("width", "height")
style(width, height) {
if (width && height) {
return htmlSafe(`--aspect-ratio: ${width / height};`);
}
},
```
Since `style="--aspect-ratio"` is only set when the component is called with "width" and "height", I quickly run into a loophole. As far as I understand, it can only be solved by modifying the behavior of the previously mentioned code, which I tried with no luck.
إعجابَين (2)
system
(system)
تم إغلاقه في
23 يونيو 2023، 3:09م
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.