feat: ai widget - improve style

This commit is contained in:
Azgaar 2024-09-22 14:29:38 +02:00
parent d94defaa18
commit 85a6bc9c66
5 changed files with 24 additions and 7 deletions

View file

@ -447,6 +447,7 @@ function changeDialogsTheme(themeColor, transparency) {
};
const theme = [
{name: "--bg-opacity", value: alpha},
{name: "--bg-main", h, s, l, alpha},
{name: "--bg-lighter", h, s, l: l + 0.02, alpha},
{name: "--bg-light", h, s: s - 0.02, l: l + 0.06, alpha},
@ -459,8 +460,9 @@ function changeDialogsTheme(themeColor, transparency) {
];
const sx = document.documentElement.style;
theme.forEach(({name, h, s, l, alpha}) => {
sx.setProperty(name, getRGBA(h, s, l, alpha));
theme.forEach(({name, value, h, s, l, alpha}) => {
if (value !== undefined) sx.setProperty(name, value);
else sx.setProperty(name, getRGBA(h, s, l, alpha));
});
}