1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Added theme for browser action popup

First draft for #232.
This commit is contained in:
kkapsner 2018-08-21 21:53:13 +02:00
parent 454873b6df
commit 1cb5f6efa9
8 changed files with 103 additions and 9 deletions

View file

@ -9,6 +9,16 @@
logging.message("Opened browser action");
settings.onloaded(function(){
// load theme
var themeLink = document.createElement("link");
themeLink.href = `browserAction-${settings.theme}.css`;
themeLink.rel = "stylesheet";
themeLink.type = "text/css";
document.head.appendChild(themeLink);
settings.on("theme", function(){
themeLink.href = `browserAction-${settings.theme}.css`;
});
var actions = document.getElementById("actions");
[
@ -55,8 +65,9 @@
var actionButton = document.createElement("button");
actionButton.className = "action";
var icon = document.createElement("img");
icon.src = action.icon;
var icon = document.createElement("span");
icon.className = "icon";
icon.style.maskImage = "url(" + action.icon + ")";
actionButton.appendChild(icon);