mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 21:17:20 +03:00
Generate darkreader variables with our category color variables
This ensures the timeline, fv labels and thumbnail labels don't go transparent if darkreader forgets to set it's variable overrides.
This commit is contained in:
@@ -2445,9 +2445,11 @@ function setCategoryColorCSSVariables() {
|
|||||||
let css = ":root {"
|
let css = ":root {"
|
||||||
for (const [category, config] of Object.entries(Config.config.barTypes)) {
|
for (const [category, config] of Object.entries(Config.config.barTypes)) {
|
||||||
css += `--sb-category-${category}: ${config.color};`;
|
css += `--sb-category-${category}: ${config.color};`;
|
||||||
|
css += `--darkreader-bg--sb-category-${category}: ${config.color};`;
|
||||||
|
|
||||||
const luminance = GenericUtils.getLuminance(config.color);
|
const luminance = GenericUtils.getLuminance(config.color);
|
||||||
css += `--sb-category-text-${category}: ${luminance > 128 ? "black" : "white"};`;
|
css += `--sb-category-text-${category}: ${luminance > 128 ? "black" : "white"};`;
|
||||||
|
css += `--darkreader-text--sb-category-text-${category}: ${luminance > 128 ? "black" : "white"};`;
|
||||||
}
|
}
|
||||||
css += "}";
|
css += "}";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user