Existe também a possibilidade de fazer upload de dois tipos de logotipos para categorias e escolher o apropriado dependendo do Tema do Discourse selecionado. Como exemplo:
Tema Claro: Logotipo Preto
Tema Escuro: Logotipo Branco
Obrigado!
david
(David Taylor)
Março 30, 2022, 8:29am
2
No momento, não acho que tenhamos algo assim integrado. No entanto, pode ser possível através de um componente de tema.
Movi esta pergunta para um tópico próprio para que tenha mais visibilidade - talvez alguém já tenha resolvido esse problema no passado
pmusaraj
(Penar Musaraj)
Outubro 7, 2022, 3:29pm
3
Graças a @jancernik , isso agora é um recurso no core. Assim como o logotipo do site, agora você pode fazer upload de logotipos escuros para categorias, e eles serão usados quando no modo escuro.
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.