Don't load all themes into every tab

This commit is contained in:
Oliver Blanthorn 2021-01-26 21:37:13 +01:00
parent 90dd599904
commit 1d9380d183
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
9 changed files with 21 additions and 14 deletions

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
set -e
imports=$(find src/static/themes -name '*.css'| awk -F"/" '{ printf "@import url('\''../%s/%s/%s'\'');\n", $3, $4, $5 }')
for css in build/static/css/*.css; do
printf '%s\n%s\n' "$imports" "$(cat "$css")" > "$css"
done

View file

@ -67,7 +67,6 @@ if [ "$1" = "--old-native" ]; then
fi
fi
scripts/bodgecss.sh
scripts/authors.sh
if [ -e "$CLEANSLATE" ] ; then

View file

@ -46,8 +46,14 @@ export async function theme(element) {
}
// Insert custom css if needed
if (newTheme !== "default" && !THEMES.includes(newTheme)) {
customCss.code = await config.getAsync("customthemes", newTheme)
if (newTheme !== "default") {
customCss.code = THEMES.includes(newTheme)
? "@import url('" +
browser.runtime.getURL(
"static/themes/" + newTheme + "/" + newTheme + ".css",
) +
"');"
: await config.getAsync("customthemes", newTheme)
if (customCss.code) {
await browserBg.tabs.insertCSS(await ownTabId(), customCss)
insertedCSS = true

View file

@ -1,3 +1,5 @@
@import url("../themes/default/default.css");
/* Adapted from https://css-tricks.com/snippets/css/star-wars-crawl-text/ */
body {
width: 100%;

View file

@ -1,3 +1,5 @@
@import url("../themes/default/default.css");
body {
overflow: hidden;
margin: 0;

View file

@ -1,3 +1,5 @@
@import url("../themes/default/default.css");
#cmdline_iframe {
position: fixed !important;
bottom: 0 !important;

View file

@ -1,3 +1,5 @@
@import url("../themes/default/default.css");
span.TridactylHint {
position: absolute !important;
font-family: var(--tridactyl-hintspan-font-family) !important;
@ -47,5 +49,5 @@ span.TridactylJSHint {
background-color: var(--tridactyl-hintspan-js-background) !important;
}
.TridactylKilledElem {
display: none !important;
display: none !important;
}

View file

@ -1,3 +1,5 @@
@import url("../themes/default/default.css");
body {
font-family: var(--tridactyl-font-family-sans);
font-size: var(--tridactyl-font-size);

View file

@ -1,3 +1,5 @@
@import url("../themes/default/default.css");
#TridactylViewsourceElement {
position: absolute !important;
/* This is the z-index of hint.css and content.css -1 */