From 535dd5bb6795e0110b8ceac35c6a602749d44f64 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Sun, 20 May 2018 15:04:46 +0100 Subject: [PATCH] Make injection of theme scripts automatic --- scripts/bodgecss.sh | 9 +++++++++ scripts/build.sh | 2 ++ src/static/css/commandline.css | 4 ---- src/static/css/content.css | 4 ---- src/static/css/hint.css | 4 ---- src/static/css/viewsource.css | 1 - 6 files changed, 11 insertions(+), 13 deletions(-) create mode 100755 scripts/bodgecss.sh diff --git a/scripts/bodgecss.sh b/scripts/bodgecss.sh new file mode 100755 index 00000000..0c5b4f2a --- /dev/null +++ b/scripts/bodgecss.sh @@ -0,0 +1,9 @@ +#!/bin/env bash + +imports=$(find src/static/themes/ -name *.css| sed "s/^src\/static\///" | sed "s/^.*$/@import url\('..\/\0'\);/") + +shopt -s globstar + +for css in $(ls 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 5f377849..f69f2653 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -55,6 +55,8 @@ fi wait +scripts/bodgecss.sh + if [ -e "$CLEANSLATE" ] ; then cp -v "$CLEANSLATE" build/static/css/cleanslate.css else diff --git a/src/static/css/commandline.css b/src/static/css/commandline.css index bfc2a9ca..c07d9e81 100644 --- a/src/static/css/commandline.css +++ b/src/static/css/commandline.css @@ -1,7 +1,3 @@ -@import url('../themes/default/commandline.css'); -@import url('../themes/dark/commandline.css'); -@import url('../themes/greenmat/commandline.css'); - body { overflow: hidden; margin: 0; diff --git a/src/static/css/content.css b/src/static/css/content.css index 5a91c053..d0ebf79d 100644 --- a/src/static/css/content.css +++ b/src/static/css/content.css @@ -1,7 +1,3 @@ -@import url('../themes/default/content.css'); -@import url('../themes/dark/content.css'); -@import url('../themes/greenmat/content.css'); - #cmdline_iframe { position: fixed !important; bottom: 0 !important; diff --git a/src/static/css/hint.css b/src/static/css/hint.css index 7d6213d5..e3ed4172 100644 --- a/src/static/css/hint.css +++ b/src/static/css/hint.css @@ -1,7 +1,3 @@ -@import url('../themes/default/content.css'); -@import url('../themes/dark/content.css'); -@import url('../themes/greenmat/content.css'); - span.TridactylHint { position: absolute !important; font-family: var(--tridactyl-hintspan-font-family) !important; diff --git a/src/static/css/viewsource.css b/src/static/css/viewsource.css index 523cb36f..d638841f 100644 --- a/src/static/css/viewsource.css +++ b/src/static/css/viewsource.css @@ -1,4 +1,3 @@ - #TridactylViewsourceElement { position: absolute !important; /* This is the z-index of hint.css and content.css -1 */