Skip to content

Commit

Permalink
fix: apply theme rules. Closes #259
Browse files Browse the repository at this point in the history
  • Loading branch information
ChugunovRoman committed Feb 19, 2022
1 parent e62e0ec commit b377df7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/middleware/ThemesManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ export class ThemesManager {
document.body.style.setProperty("--fg-overlay-sep", value);
}
}

document.body.style.setProperty("background-color", "var(--gb-panel)");

document.body.style.setProperty("--color-bg", "var(--bg-panel)");
document.body.style.setProperty("--color-bg-selected", "var(--bg-panel)");
document.body.style.setProperty("--color-text", "var(--text)");
document.body.style.setProperty("--color-text-secondary", "var(--text)");
document.body.style.setProperty("--color-border", "var(--borders)");
document.body.style.setProperty("--color-text-disabled", "var(--text-disabled)");
}

init(): void {
Expand Down Expand Up @@ -133,6 +142,15 @@ export class ThemesManager {
if (/tool_bar--toolBarRightSide|pages_panel--pageRowSelected/.test(cssRule.selectorText)) {
cssRule.style["fill"] = `var(--text-active)`;
}
if (/.svg-container/.test(cssRule.selectorText)) {
additionStyleRules.push(`.svg-container path:not([fill="none"]) { fill: var(--text-active); }`);
}
if (/.text--_negText/.test(cssRule.selectorText)) {
additionStyleRules.push(`${cssRule.selectorText} { color: var(--fg-header); }`);
}
if (/.navbar--workspaceSubtitle/.test(cssRule.selectorText)) {
additionStyleRules.push(`${cssRule.selectorText} { color: var(--fg-header); }`);
}
if (/upgrade_section--icon/.test(cssRule.selectorText)) {
additionStyleRules.push(`span[class*="upgrade_section--icon"] > svg > path { fill: var(--text); }`);
}
Expand Down

0 comments on commit b377df7

Please sign in to comment.