È anche possibile caricare due tipi di loghi per le categorie e scegliere quello appropriato a seconda del tema Discourse selezionato. Ad esempio:
Tema chiaro: Logo nero
Tema scuro: Logo bianco
Grazie!
1 Mi Piace
david
(David Taylor)
30 Marzo 2022, 8:29am
2
Al momento non credo che abbiamo nulla di simile integrato. Tuttavia, potrebbe essere possibile tramite un componente del tema.
Ho spostato questa domanda in un argomento separato in modo che ottenga maggiore visibilità: forse qualcun altro ha già risolto questo problema
1 Mi Piace
pmusaraj
(Penar Musaraj)
7 Ottobre 2022, 3:29pm
3
Grazie a @jancernik , questa è ora una funzionalità nel core. Come il logo del sito, ora puoi caricare loghi scuri per le categorie, e verranno utilizzati quando si è in modalità scura.
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 Mi Piace
system
(system)
Chiuso
23 Giugno 2023, 3:09pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.