21

The recent change from Prettify to highlight.js lead to surprising changes in code rendering.

Is there a simple way to customize the theme colors beyond the light/dark switch?

highlight.js comes with a slew of predefined style choices (98 in the src/styles directory). Style is obviously a matter of personal taste, well suited for a tab in users/preferences but I did not find it.

Did I miss a configuration option or is there a preferred way to customize the theme?

15
  • 11
    +1, but also: this does not feel like an intended change at all. At least to me, it was only clear that the underlying syntax highlight engine would change, not the color scheme too. To be honest, code right now is incomprehensible. For example, function names, numbers, constants, and variables all have the same color in C. It's just painful to look at. Sep 24, 2020 at 21:58
  • 7
    I hope default style gets tweaked...I'm a vanilla guy.
    – bad_coder
    Sep 24, 2020 at 23:17
  • 6
    To be honest, I liked when functions were colored in Blue rather than Orange.
    – 10 Rep
    Sep 25, 2020 at 0:48
  • 4
    Rather than making it configurable/customizable and introducing decision fatigue, I'd prefer if they just kept the sensible default we've been happily (speaking for myself...) using as suggested here.
    – ggorlen
    Sep 25, 2020 at 3:34
  • 1
    You could probably set them using a user stylesheet for the site. See Has somebody already created a user style of a more readable Stack Overflow? for example. You'd just need to target the classes added by highlight.js. Sep 25, 2020 at 12:23
  • <10K users can find CSS changes here
    – Scratte
    Sep 25, 2020 at 17:53
  • @Scratte Why delete your answer?
    – 10 Rep
    Sep 25, 2020 at 17:55
  • @10Rep I have issues with the edit. I have no issues with deleting my posts.
    – Scratte
    Sep 25, 2020 at 17:56
  • @Scratte: The link to the stylus extension was useful too .
    – chqrlie
    Sep 25, 2020 at 17:59
  • 2
    @chqrlie It's still there with the american spelling of colour, the wrong impression that changes are made by a simple status-review, and some other strange edit. I don't mind improving posts, but this one wasn't it. I felt it made it worse.
    – Scratte
    Sep 25, 2020 at 18:01
  • @Scratte: you can revert edits to you answers with a single click :) I downloaded the stylus extension, but it does not fit my definition of simple: I am not installing an extension with 100K lines source code to just patch half a dozen css styles. So the question remains: Is there a simple way to customize the theme colors
    – chqrlie
    Sep 25, 2020 at 18:11
  • @Scratte: On a lighter note, it seems 10Rep changed the spelling of colours but missed the typo on stulys :)
    – chqrlie
    Sep 25, 2020 at 18:15
  • @chqrlie I have two ways to make such changes. 1. Using a styles extension, like stylus. 2. Do it with a user script using a user script manager extension. 1 is the "lighter" choice. I'm not aware of any other way, but I'm also not a HTML/CSS/JavaScript developer. I just wing it :D On the matter of the edit: I'm not starting a rollback war. Once a bad edit comes in on a post of mine, I just remove it. Ahh yes, I made a typo. I'll leave it there though ;)
    – Scratte
    Sep 25, 2020 at 18:16
  • @Scratte I made the edit in good faith. If you didn't like it, a simple ping and rollback would have been good. I truly didn't know for instance that colours is also correct. And I don't engage in rollback wars, since I know I am not a very good editor.
    – 10 Rep
    Sep 25, 2020 at 19:59
  • @charlietfl I would not install stylish, see “Stylish” extension with 2M downloads banned for tracking every site visit. The CSS in the deleted post is also in a link in a comment. Nothing is lost.
    – Scratte
    Sep 25, 2020 at 20:50

0

You must log in to answer this question.

Browse other questions tagged .