lemmy
lemmy copied to clipboard
Add "code-theme" settings for user and site
Is your proposal related to a problem?
I'm working on adding "syntax highlighting for code blocks" which is trivial, but would be improved by allowing users to select their preferred theme. https://github.com/LemmyNet/lemmy-ui/pull/663
Describe the solution you'd like
Just like how users and site-admins can set a preferred ui-theme, they should be able to set a preferred code-theme.
Describe alternatives you've considered
A simpler, bit possibly less desirable solution would be to have UI themes @import
a correlating code-theme, and prevent the need for any backend changes.
I really dont see the benefit of this. Its more complex to implement, and more complicated for users to configure it right. Having the code theme specified as part of the main theme makes a lot of sense to me, because that can take into account the color schemes, or even add a custom code theme if necessary. If there is a problem with contrast or such, it can simply be fixed in the theme itself. But with this proposal, each user would manually have to switch to a different code theme, and hope that it works out. Plus, if you switch from a dark to a light theme, you would also manually have to switch the code them.
So i really prefer the @import
solution.
@Nutomic I believe there is a big benefit to disconnecting code theme and site theme since users just dont like the same code themes. As part of the dropdown there could be a default option of "match site" that changes the code theme based on the site theme that people can have as default and then they can explicitly set one in the dropdown instead as well. This means they dont have to worry about it but the option is still there
Lemmy is not made for programmers, I doubt most people use code blocks at all. In fact even Github which is specifically made for programmers doesnt have a way to set separate code themes.
So if you want to change code themes, either do it as part of a new custom theme, or use some kind of browser extension to change the design.