1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-15 14:09:36 +02:00

Added centralized theme system and themed all pages

This commit is contained in:
kkapsner 2019-05-02 00:30:30 +02:00
parent c2a817478e
commit 6301b744d2
39 changed files with 448 additions and 127 deletions

View file

@ -1,12 +0,0 @@
body {
background-color: rgb(74, 74, 79);
color: rgb(249, 249, 250);
}
.action {
border-color: rgb(92, 92, 97);
}
.action:active, .action:hover, .action:focus {
background-color: rgb(92, 92, 97);
}

View file

@ -1,12 +0,0 @@
body {
color: rgb(60, 62, 60);
background-color: rgb(249, 250, 249);
}
.action {
border-color: rgb(185, 185, 185);
}
.action:active, .action:hover, .action:focus {
background-color: rgb(236, 237, 236);
}

View file

@ -1,12 +0,0 @@
body {
color: rgb(12, 12, 13);
background-color: rgb(255, 255, 255);
}
.action {
border-color: rgb(222, 222, 222);
}
.action:active, .action:hover, .action:focus {
background-color: rgb(240, 240, 240);
}

View file

@ -10,7 +10,9 @@ div {
.action {
display: block;
padding: 0.5em;
margin: 0;
background-color: transparent;
background-image: none;
border: 1px solid currentColor;
cursor: pointer;
width: 100%;

View file

@ -13,6 +13,7 @@
<script src="../lib/settingDefinitions.js"></script>
<script src="../lib/settingContainers.js"></script>
<script src="../lib/settings.js"></script>
<script src="../lib/theme.js"></script>
<script src="browserAction.js"></script>
</body>
</html>

View file

@ -7,19 +7,10 @@
const extension = require("../lib/extension");
const logging = require("../lib/logging");
const settings = require("../lib/settings");
require("../lib/theme").init("browserAction");
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");
[