diff --git a/scripts/bodgecss.sh b/scripts/bodgecss.sh deleted file mode 100755 index 83ef511c..00000000 --- a/scripts/bodgecss.sh +++ /dev/null @@ -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 diff --git a/scripts/build.sh b/scripts/build.sh index a616ba04..145b1d73 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -67,7 +67,6 @@ if [ "$1" = "--old-native" ]; then fi fi -scripts/bodgecss.sh scripts/authors.sh if [ -e "$CLEANSLATE" ] ; then diff --git a/src/content/styling.ts b/src/content/styling.ts index 381194d1..087be8f7 100644 --- a/src/content/styling.ts +++ b/src/content/styling.ts @@ -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 diff --git a/src/static/css/authors.css b/src/static/css/authors.css index 5bf4613e..5a9f0ca7 100644 --- a/src/static/css/authors.css +++ b/src/static/css/authors.css @@ -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%; diff --git a/src/static/css/commandline.css b/src/static/css/commandline.css index 97260601..7023e421 100644 --- a/src/static/css/commandline.css +++ b/src/static/css/commandline.css @@ -1,3 +1,5 @@ +@import url("../themes/default/default.css"); + body { overflow: hidden; margin: 0; diff --git a/src/static/css/content.css b/src/static/css/content.css index 5d377bfb..00d47cd9 100644 --- a/src/static/css/content.css +++ b/src/static/css/content.css @@ -1,3 +1,5 @@ +@import url("../themes/default/default.css"); + #cmdline_iframe { position: fixed !important; bottom: 0 !important; diff --git a/src/static/css/hint.css b/src/static/css/hint.css index 5974a938..c27696d5 100644 --- a/src/static/css/hint.css +++ b/src/static/css/hint.css @@ -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; } diff --git a/src/static/css/newtab.css b/src/static/css/newtab.css index bf9a3567..a7b4f96a 100644 --- a/src/static/css/newtab.css +++ b/src/static/css/newtab.css @@ -1,3 +1,5 @@ +@import url("../themes/default/default.css"); + body { font-family: var(--tridactyl-font-family-sans); font-size: var(--tridactyl-font-size); diff --git a/src/static/css/viewsource.css b/src/static/css/viewsource.css index e587c89a..9121e32a 100644 --- a/src/static/css/viewsource.css +++ b/src/static/css/viewsource.css @@ -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 */