Page 1 of 1

dev.lemmy.ml not showing correctly

Posted: 2020-03-01, 10:25
by kujaw
HI, everything is in this post: https://dev.lemmy.ml/post/30957/comment/2763

Colors in light themes don't show correctly on Palemoon 28.8.3.
On Firefox 73.0.1 colors are ok.

[edit]
spelling

Re: dev.lemmy.ml not showing correctly

Posted: 2020-03-01, 10:43
by Moonchild
Despite what was asserted in that thread it -is- a problem with Lemmy.

darkly.min.css which is loaded despite choosing a different theme overrides the Litera text color with an !important rule.

Pale Moon is doing exactly what it is told to do.

Re: dev.lemmy.ml not showing correctly

Posted: 2020-03-02, 10:31
by kujaw
Since I've already posted on Lemmy's Github about the issue, could you take a look, please? I am in no position to agree with any of you guy because of my lack of knowledge.
https://github.com/dessalines/lemmy/issues/570

Re: dev.lemmy.ml not showing correctly

Posted: 2020-03-02, 11:25
by Moonchild
I replied on the issue.

The problem is they try to disable/unload styles by setting the "disabled" attribute on the stylesheet's <link> element. That doesn't work in Pale Moon (and didn't work in Firefox either prior to 68 at which point they aped Chrome in that respect despite the spec. Blink and Gecko behave different even with that change, though.

The disabled attribute on <link> is not specced in the HTML standard. There has been some discussion about it because apparently it's the only way in Chrome/Blink to disable style sheets (of which the logic is really fishy (not my words)) but since it's not in the spec to support the "disabled" attribute on <link> elements (and it doesn't really make sense to do so, anyway!), we don't. As a result the darkly theme remains loaded and is overridden by other themes in proper cascading style fashion, except, of course, where darkly has an !important attribute set so it breaks the cascade. this is the case for color on darkly's body selector, overruling the loaded light themes which don't use !important.

I asked the lemmy dev to please be more browser-agnostic in the way they switch themes. I suggested avoiding any and all !important rules in the default theme so styles can be applied dynamically on top, or not loading darkly by default before applying the chosen theme.