You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
better naming
This commit is contained in:
@@ -39,7 +39,7 @@ export function enumerateThemes() {
|
|||||||
function setCustomThemeVars(customTheme) {
|
function setCustomThemeVars(customTheme) {
|
||||||
const {style} = document.body;
|
const {style} = document.body;
|
||||||
|
|
||||||
function setCSSVariable(name, hexColor, doPct = true) {
|
function setCSSColorVariable(name, hexColor, doPct = true) {
|
||||||
style.setProperty(`--${name}`, hexColor);
|
style.setProperty(`--${name}`, hexColor);
|
||||||
if (doPct) {
|
if (doPct) {
|
||||||
// uses #rrggbbaa to define the color with alpha values at 0%, 15% and 50%
|
// uses #rrggbbaa to define the color with alpha values at 0%, 15% and 50%
|
||||||
@@ -53,10 +53,10 @@ function setCustomThemeVars(customTheme) {
|
|||||||
for (const [name, value] of Object.entries(customTheme.colors)) {
|
for (const [name, value] of Object.entries(customTheme.colors)) {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
for (let i = 0; i < value.length; i += 1) {
|
for (let i = 0; i < value.length; i += 1) {
|
||||||
setCSSVariable(`${name}_${i}`, value[i], false);
|
setCSSColorVariable(`${name}_${i}`, value[i], false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setCSSVariable(name, value);
|
setCSSColorVariable(name, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user