From bb4d0ce58b2d67b4b0384f215da51c9595919633 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Tue, 14 May 2024 17:41:28 +0200 Subject: [PATCH] Theme and script updates --- src/styles/variables/theme.css | 2 +- tasks/copy-assets-to-targets.sh | 34 ++++++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/styles/variables/theme.css b/src/styles/variables/theme.css index b05084d..cc03cc5 100644 --- a/src/styles/variables/theme.css +++ b/src/styles/variables/theme.css @@ -14,7 +14,7 @@ --btcpay-bg-tile: var(--btcpay-white); --btcpay-bg-dark: var(--btcpay-brand-dark); - --btcpay-body-bg: var(--btcpay-neutral-100); + --btcpay-body-bg: rgb(var(--btcpay-body-bg-rgb)); --btcpay-body-bg-light: var(--btcpay-white); --btcpay-body-bg-medium: var(--btcpay-neutral-200); --btcpay-body-bg-striped: var(--btcpay-neutral-200); diff --git a/tasks/copy-assets-to-targets.sh b/tasks/copy-assets-to-targets.sh index d141baf..11e00ea 100755 --- a/tasks/copy-assets-to-targets.sh +++ b/tasks/copy-assets-to-targets.sh @@ -23,20 +23,36 @@ if [ -d "$BTCPAY_SERVER_WWWROOT" ]; then echo "Copied assets to $BTCPAY_SERVER_WWWROOT" fi -if [ -d "$BTCPAY_APP_WWWROOT" ]; then - cp dist/styles/btcpayserver-bootstrap.css "$BTCPAY_APP_WWWROOT/bootstrap/bootstrap.css" - cp dist/scripts/bootstrap/* "$BTCPAY_APP_WWWROOT/bootstrap/" - cp dist/svg/icons.svg "$BTCPAY_APP_WWWROOT/img/icon-sprite.svg" - cp dist/svg/supporters.svg "$BTCPAY_APP_WWWROOT/img/supporter-sprite.svg" - - echo "Copied assets to $BTCPAY_APP_WWWROOT" -fi - if [ -d "$BTCPAY_APP_SERVER_WWWROOT" ]; then cp dist/styles/btcpayserver-bootstrap.css "$BTCPAY_APP_SERVER_WWWROOT/main/bootstrap/bootstrap.css" cp dist/scripts/bootstrap/* "$BTCPAY_APP_SERVER_WWWROOT/vendor/bootstrap/" cp dist/svg/icons.svg "$BTCPAY_APP_SERVER_WWWROOT/img/icon-sprite.svg" cp dist/svg/supporters.svg "$BTCPAY_APP_SERVER_WWWROOT/img/supporter-sprite.svg" + # Update default.css + rootSelector=":root {[\s\S]*?}\n" + defaultCSS="$BTCPAY_APP_SERVER_WWWROOT/main/themes/default.css" + defaultRoot=$(cat dist/styles/btcpayserver-variables.css | grep -oPz "$rootSelector") + perl -0777 -i -pe "s/$rootSelector//" $defaultCSS + echo -e "$defaultRoot\n$(cat $defaultCSS)" > $defaultCSS + + # Update default-dark.css + rootDarkSelector=":root\[data-btcpay-theme='dark'\] {[\s\S]*?}\n" + defaultDarkCSS="$BTCPAY_APP_SERVER_WWWROOT/main/themes/default-dark.css" + defaultDarkRoot=$(cat dist/styles/btcpayserver-variables.css | grep -oPz "$rootDarkSelector" | sed "s/\[data-btcpay-theme='dark'\]//g") + perl -0777 -i -pe "s/$rootSelector//" $defaultDarkCSS + echo -e "$defaultDarkRoot$(cat $defaultDarkCSS)" > $defaultDarkCSS + echo "Copied assets to $BTCPAY_APP_SERVER_WWWROOT" fi + +if [ -d "$BTCPAY_APP_WWWROOT" ]; then + cp dist/styles/btcpayserver-bootstrap.css "$BTCPAY_APP_WWWROOT/bootstrap/bootstrap.css" + cp dist/scripts/bootstrap/* "$BTCPAY_APP_WWWROOT/bootstrap/" + cp dist/svg/icons.svg "$BTCPAY_APP_WWWROOT/img/icon-sprite.svg" + cp dist/svg/supporters.svg "$BTCPAY_APP_WWWROOT/img/supporter-sprite.svg" + + cp dist/styles/btcpayserver-variables.css "$BTCPAY_APP_WWWROOT/css/theme.css" + + echo "Copied assets to $BTCPAY_APP_WWWROOT" +fi