I noticed that with one of the recent updates to Discourse the code blocks now have a darker gray background, which makes the text hardly readable. E.g.:
$noop(Nice names for some special countries)
$if($eq(%releasecountry%,XE),$set(releasecountry,Europe),)
$if($eq(%releasecountry%,XG),$set(releasecountry,DDR),)
$if($eq(%releasecountry%,XU),$set(releasecountry,[Unknown] ),)
$if($eq(%releasecountry%,XW),$set(releasecountry,[Worldwide]),)
@Freso , @Zas : Is it possible to update the stylesheet? I don’t know how this was configured previously, but something like
Using the Discourse default dark theme, the first line in your initial example is readable, but it’s still not great with white (or light grey!) text on grey background. However, is this an issue specifically with taggerscript or does it also apply to other code highlighting?
If it’s only for taggerscript then maybe there are some changes from other code highlights that need to be merged into the taggerscript highlighter. AFAIK both our light and regular dark themes are “vanilla Discourse”, so I’d expect to see similar complaints on meta.discourse.org but I didn’t find any in a quick glance.
I don’t know if this is helpful or not, but I don’t want to implement a number of hackarounds if there’s an underlying issue that ought to be fixed upstream.
No, this is not specific to tagger script. The way this works the language implementations don’t know anything about formatting, they just mark code regarding to it’s function. E.g. in the above example the first line is totally unreadable because it is marked as a comment, and comments have the CSS class hljs-comment which gets the color #998, which is unfortunately close enough to the background color of the code block (#919999).
You get the same issue with other styles of comments:
<!-- A HTML comment -->
<p>There is a HTML comment in front of this line</p>
// A C style comment
printf("There is a C style comment in front of this line")
Indeed, the light theme on mobile also looks good. @Freso are you sure there are no custom CSS for this? I know we had some CSS customization done to the forums here.
We had a “Picard-style Tagger Script highlighting” theme component that I’ve removed now. The code blocks seem a bit better for me in default dark theme. Do they look better/ok for you now on light theme?
This is the code that is/was in said theme component (I’m not sure where I got it from, but I think maybe you (@outsidecontext) were the one who made it?):
Ah, yes. That code was meant to mimic the coloring used inside Picard, but actually I think it was changed at some point and no longer matched the Picard colors (on the Picard website it still does).
I think the bad thing here actually was:
pre code {
background: #919999;
}
Not sure when and how this sneaked in, but it definitely was wrong. Do we still want to allow the Picard look for tagger script? Or are we ok with the default here? It is a bit less colorful, but otherwise fine.
I honestly don’t care much either way. I’m happy with default Discourse colouring (as @jesus2099 says, that seems like the path less prone to randomly stop working), but if the community here would prefer that it looks more similar to how it looks in Picard, I’m also happy to update the CSS code/theme component.
If anyone is invested in this but don’t want to comment, go ahead and give your thoughts here: