lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Add "code-theme" settings for user and site

Open Thann opened this issue 2 years ago • 1 comments

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.

Thann avatar Jun 08 '22 15:06 Thann

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 avatar Jun 09 '22 20:06 Nutomic

@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

Ategon avatar Oct 20 '23 15:10 Ategon

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.

Nutomic avatar Oct 23 '23 09:10 Nutomic