Skip to content

Move hljs import to theme file

Himanshu Kapoor requested to merge himkp-master-patch-41115 into master

When using CSS variables, the variables should either have a fallback value assigned or we need to be sure they are defined somewhere before being used, otherwise the empty variables override existing styles.

Since we also use highlight.js in the content editor in wiki is, this change actually breaks syntax highlighting for the white theme there (and since the wikis don't support any other theme right now, syntax highlighting doesn't work at all). I assume it would have broken for other themes as well in repo view as well, but since its behind a feature flag, it wont be noticeable there. There are two ways we can go about fixing this:

  1. Define a fallback value as second parameter for all the variables in this file.
  2. Import this file only in dark.scss, since that is the only place we're defining the variables.

Method 2 is easier, but a temporary fix.

See !84051 (comment 905761210)

Content Editor Before Content Editor After
image image

Dark theme in regular blob view remains unimpacted:

image

Edited by Himanshu Kapoor

Merge request reports