canonical / vanilla-framework

From community websites to web applications, this CSS framework will help you achieve a consistent look and feel.
https://vanillaframework.io
GNU Lesser General Public License v3.0
850 stars 170 forks source link

Add theme support to code syntax highlighting #5420

Open jmuzina opened 2 days ago

jmuzina commented 2 days ago

Currently our code syntax highlighting is intended only for usage in light theme, and is not legible on dark theme.

Screenshot 2024-12-02 at 11 15 36

We should introduce theme support to the syntax highlighting mixin to use the existing Prism theme on light theme, and the "Tomorrow Night" Prism theme on dark theme.

Context

The code below hard-codes colors from Prism's default theme into Vanilla. It should be updated to vary based in color theme, so that the "Tomorrow Night" theme is applied when an element is a descendant of an is-dark element.

https://github.com/canonical/vanilla-framework/blob/80fddaa1a1b0c41bfdf6977105093a70213d3cd7/scss/_base_syntax-highlighting.scss#L27-L69

Resources

syncronize-issues-to-jira[bot] commented 2 days ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/WD-17470.

This message was autogenerated