I don’t have any handy image to compare how it was, except for the little snippet in this comment. In addition to changing the font and color, my recollection is that code voice used to be about the same size as regular text, whereas it now appears noticeably smaller.
(I think the font for regular text has also changed slightly too, perhaps increasing in “weight” or line thickness.)
Apologies for bumping my own thread, but it has been several months and I still do not understand why this change occurred, or if it was even intentional.
The code examples on swift.org still appear to use the original fonts and colors, as does the documentation in The Swift Programming Language.
It seems that the change only affects these forums, so what’s going on here?
Discourse likely updated their syntax highlighter and / or changed the default code styling, and / or this forum updated its settings. I think a Discourse change is most likely, so to get the coloring you want we'd need a custom style for this forum.
I think part of the challenge with getting engagement on this post is that there isn't a description of a before state, so it's harder to action. You mention that we used to match what is now on swift.org, so maybe some description of the differences would help understand what changed.
As @Jon_Shier says, this will likely be a change on the Discourse side. We can start by bringing it up with them, and then figure out whether this can be configured today, or made configurable, or if it would need some larger customization effort on the Swift side (and whether that is worth it, depending on how different the before and after state is). Having a description of "what it was like before and what the differences are" summary would be very helpful in that conversation.
my recollection is that code voice used to be about the same size as regular text, whereas it now appears noticeably smaller.
My observation with code voice in general on various sites/apps is that it often ends up looking bigger, even when it's supposed to be the same size. And that this sometimes interferes with line height/spacing.
which does look like the font is slightly smaller, but that this is in service of being able to put a box behind it without interfering with the line spacing. But I'm not good at web typography so I might be making a hash of this description of the current behavior.
I was kind of hoping other people could help with that. Maybe even someone might have saved the old formatting style.
I’m not particularly great with colors or fonts, but the change was sudden and substantial enough to strike me as almost jarring. So I was rather surprised that this thread didn’t get more engagement, since I was expecting many people who are good with fonts and colors would have noticed and had thoughts about the change.
The screenshot that @jamieQ shared in the 2nd comment here shows a code block as it used to be, and the difference between that and now is rather large. In addition to the font changing and the text colors going from mostly pink and light gray to having lots of orange, green, and blue, the background color also changed (at least in dark mode) from a medium gray to nearly black.
Ah I see, I missed what @jamieQ had posted was a before shot not another now example.
I believe this is indeed just an update to Discourse, not a choice by the project. We can look into how customizable per site it is (I assume it is) or per user (less likely, perhaps).
I must say, though, that looking at them side by side, the new coloring seems like an improvement to my eyes. I can understand concern the colors are garish. However, the old colors were very subdued – only using bold for keywords, not a color (which is very subtle difference) and using the same color for comments as code is fairly unusual in IDE color schemes. The new one is more in keeping with the default coloring of both Xcode and VS Code.
I can see the argument the new colors are too much, but also that the old colors were too little. Personally, I do think is that the darker background on code blocks is an improvement, as is differentiating code from comments IMO. And I also happen to prefer not using bold for certain highlighting, as I find it makes fonts less readable.