Files
decePubClient/tools/tailwind.sh
T
thepraandClaude Opus 5.5 697b2c8897
Build / Build (push) Successful in 33s
Animations, GIFs and the globe now move for every reader
decePub no longer looks at the system's "reduce motion" setting, so everything moves the same way whatever it says:
- a GIF video in a post plays by itself, muted and looping, instead of waiting for a tap; it now also starts on a page
  just opened, before the first tap, where the browser used to hold it still;
- animated custom emoji move in the emoji picker instead of showing a still picture;
- the globe turns by itself while no located post is in view, flies to the posts, and its pulses, arcs and Sun move;
- going back to the top of a feed scrolls smoothly;
- tooltips, dropdowns, menus, folding sections, toasts, loading spinners, placeholders, progress bars, radio buttons
  and ratings keep their animations: the build now takes daisyUI's reduce-motion rules out of the stylesheet
  (tools/css/motion.py, run after every Tailwind build, in watch mode too).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W4YtEKqxKjKyHkFzuRVMNA
2026-11-09 20:48:47 +01:00

84 lines
3.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Tailwind CSS standalone + daisyUI, vendored in tools/tailwind/ so building never touches the network.
# MSBuild runs `prepare` (EnsureTailwindTools in decePubClient.csproj) and then compiles Styles/app.css itself.
# bash tools/tailwind.sh prepare verify the vendored files and unpack the binary into .tools/tailwind/
# bash tools/tailwind.sh build one-off build of wwwroot/css/app.css (what MSBuild does in Debug)
# bash tools/tailwind.sh watch rebuild wwwroot/css/app.css on every change, beside `dotnet watch`
#
# tools/tailwind/ holds:
# tailwindcss-linux-x64.xz the Tailwind CSS v4.3.3 standalone binary, xz -9e compressed
# daisyui.mjs, daisyui-theme.mjs the daisyUI v5.7.47 plugins (Styles/app.css and Styles/theme.css load them)
# daisyui-llms.txt daisyUI's component reference for v5.7.x, read when writing Components/Daisy
#
# To upgrade, take the new release assets (tailwindcss-linux-x64 from Tailwind's release, daisyui.mjs and
# daisyui-theme.mjs from daisyUI's), check them against the checksums the projects publish, replace the files here
# (`xz -9e -c tailwindcss-linux-x64 > tools/tailwind/tailwindcss-linux-x64.xz`), and update the versions and every
# sha256 below. Only linux-x64 is vendored; another platform needs its binary added the same way.
set -euo pipefail
TAILWIND_VERSION=4.3.3
pinned_sha256() {
case "$1" in
tailwindcss-linux-x64) echo dc61b3ac6b8c9ca874c0cc4c57b2409791a64c5540404ca5f5367360babc313a ;;
tailwindcss-linux-x64.xz) echo 8ad24bb6ac4f615fa9a1abdf4b49143690eaa5531a62a49e89f4eab0c91ad02b ;;
daisyui.mjs) echo 85819d3fe86a852237b439b13f481481aac58e562ac47694cd11c3038e994f2a ;;
daisyui-theme.mjs) echo d92d2f488933dab757f046e81ebd4986e51e9423307798dc3545d09a15542c89 ;;
*) echo "tailwind.sh: no pinned checksum for $1" >&2; exit 1 ;;
esac
}
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
VENDOR="$ROOT/tools/tailwind"
TOOLS="$ROOT/.tools/tailwind"
TAILWIND="$TOOLS/tailwindcss"
platform() {
case "$(uname -s)-$(uname -m)" in
Linux-x86_64|Linux-amd64) echo linux-x64 ;;
*) echo "tailwind.sh: only the linux-x64 Tailwind binary is vendored (this is $(uname -s)-$(uname -m))" >&2; exit 1 ;;
esac
}
sha256_of() {
if command -v sha256sum >/dev/null; then sha256sum "$1" | cut -d' ' -f1; else shasum -a 256 "$1" | cut -d' ' -f1; fi
}
# verify <file> <pinned name>
verify() {
local actual expected
actual="$(sha256_of "$1")"
expected="$(pinned_sha256 "$2")"
if [ "$actual" != "$expected" ]; then
echo "tailwind.sh: checksum mismatch for $1 (expected $expected, got $actual)" >&2
return 1
fi
}
prepare() {
local asset
asset="tailwindcss-$(platform)"
verify "$VENDOR/daisyui.mjs" daisyui.mjs
verify "$VENDOR/daisyui-theme.mjs" daisyui-theme.mjs
if [ -f "$TAILWIND" ] && verify "$TAILWIND" "$asset" 2>/dev/null; then return; fi
command -v xz >/dev/null || { echo "tailwind.sh: xz is needed to unpack $asset.xz" >&2; exit 1; }
verify "$VENDOR/$asset.xz" "$asset.xz"
echo "tailwind.sh: unpacking Tailwind CSS v$TAILWIND_VERSION ($asset) into .tools/tailwind/"
mkdir -p "$TOOLS"
xz -dc "$VENDOR/$asset.xz" > "$TAILWIND.part"
verify "$TAILWIND.part" "$asset" || { rm -f "$TAILWIND.part"; exit 1; }
chmod +x "$TAILWIND.part"
mv "$TAILWIND.part" "$TAILWIND"
}
cd "$ROOT"
case "${1:-build}" in
prepare) prepare ;;
build) prepare; "$TAILWIND" -i Styles/app.css -o wwwroot/css/app.css --optimize; python3 -I tools/css/motion.py wwwroot/css/app.css ;;
watch) prepare; "$TAILWIND" -i Styles/app.css -o wwwroot/css/app.css --watch 2>&1 | while IFS= read -r line; do
echo "$line"
case "$line" in Done*) python3 -I tools/css/motion.py wwwroot/css/app.css ;; esac
done ;;
*) echo "usage: tailwind.sh [prepare|build|watch]" >&2; exit 2 ;;
esac