speed-highlight / core

A lightweight syntax highlighter written in JavaScript
https://speed-highlight.github.io/core/examples/
Creative Commons Zero v1.0 Universal
252 stars 14 forks source link

[BUG] [class*=shj-lang-] color & background defined twice in github-* themes #41

Open dflock opened 4 months ago

dflock commented 4 months ago

Information

Description

If we look at github-dark.css, for example, we see this at the top:

[class*='shj-lang-'] {
    white-space: pre;
    margin: 10px 0;
    border-radius: 10px;
    padding: 30px 20px;
    background: #fff;
    color: #112;
...

and this further down:

[class*='shj-lang-'] {
    color: #24292f;
    background: #fff;
}

This a bit redundant and also makes it slightly harder to update these styles, which is how I bumped into this.

Expected behavior Just define the color & background once.

I just wanted to add that this project is awesome! Super lightweight and fast - the best lightweight highlighting library 0 thanks!

matubu commented 4 months ago

It's because there is a base style in default.css that is imported in every other style sheets, and then only the colors are changed. I thought the minifier would merge rules. I will look into that