mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-30 22:37:22 +03:00
Merge pull request #1704 from mini-bomba/darkreader-proofing-the-dynamic-css
Darkreader-proofing the dynamic CSS variables
This commit is contained in:
@@ -2445,9 +2445,11 @@ function setCategoryColorCSSVariables() {
|
||||
let css = ":root {"
|
||||
for (const [category, config] of Object.entries(Config.config.barTypes)) {
|
||||
css += `--sb-category-${category}: ${config.color};`;
|
||||
css += `--darkreader-bg--sb-category-${category}: ${config.color};`;
|
||||
|
||||
const luminance = GenericUtils.getLuminance(config.color);
|
||||
css += `--sb-category-text-${category}: ${luminance > 128 ? "black" : "white"};`;
|
||||
css += `--darkreader-text--sb-category-text-${category}: ${luminance > 128 ? "black" : "white"};`;
|
||||
}
|
||||
css += "}";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user