Skip to content

Commit

Permalink
Theme and script updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisreimann committed May 14, 2024
1 parent 38b82b0 commit bb4d0ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/styles/variables/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
34 changes: 25 additions & 9 deletions tasks/copy-assets-to-targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bb4d0ce

Please sign in to comment.