feat(web): replace Pico CSS with Tailwind standalone CLI (dark+pink theme)

- Download Tailwind v4.3.0 standalone CLI binary (gitignored)
- Define custom dark+pink theme tokens in input.css
- Add dev.sh for parallel Tailwind watcher + uvicorn
- Update Dockerfile to build Tailwind during image build
- Update templates with Tailwind utility classes
- Generate minified output.css at build time
This commit is contained in:
ZTatman 2026-05-15 16:41:55 -04:00
parent 508d21f1c5
commit dbc6af8099
7 changed files with 80 additions and 35 deletions

4
.gitignore vendored
View file

@ -15,3 +15,7 @@ web/__pycache__/
web/*.py[cod]
**/__pycache__/
**/*.pyc
# Tailwind standalone CLI
web/tailwindcss
web/app/static/css/output.css

View file

@ -14,6 +14,12 @@ RUN UV_NO_DEV=1 uv sync --frozen --no-cache && chown -R appuser:appuser /app
COPY --chown=appuser:appuser . .
# Build Tailwind CSS
RUN curl -sL https://github.com/tailwindlabs/tailwindcss/releases/download/v4.3.0/tailwindcss-linux-x64 -o /tmp/tailwindcss && \
chmod +x /tmp/tailwindcss && \
/tmp/tailwindcss -i app/static/css/input.css -o app/static/css/output.css --minify && \
rm /tmp/tailwindcss
USER appuser
EXPOSE 8000

View file

@ -0,0 +1,17 @@
@import "tailwindcss";
@theme {
--color-surface: #0f0f1a;
--color-surface-alt: #1a1a2e;
--color-surface-raised: #24243e;
--color-primary: #ec4899;
--color-primary-hover: #db2777;
--color-primary-muted: rgba(236, 72, 153, 0.15);
--color-text: #e2e8f0;
--color-text-muted: #94a3b8;
--color-border: #334155;
--color-border-light: #1e293b;
--color-success: #22c55e;
--color-warning: #f59e0b;
--color-danger: #ef4444;
}

View file

@ -1,29 +1,27 @@
<!DOCTYPE html>
<html lang="en" data-theme="jade">
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Myst{% endblock %}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.jade.min.css">
<link rel="stylesheet" href="/static/css/output.css">
<script src="https://unpkg.com/htmx.org@2"></script>
</head>
<body>
<header class="container">
<nav>
<ul>
<li><strong><a href="/">Myst</a></strong></li>
</ul>
<ul>
<body class="bg-surface text-text min-h-screen">
<header class="border-b border-border-light">
<div class="mx-auto max-w-6xl flex items-center justify-between px-4 py-3">
<a href="/" class="text-xl font-bold text-primary hover:text-primary-hover">Myst</a>
<nav class="flex items-center gap-4">
{% if user %}
<li><a href="/dashboard">Dashboard</a></li>
<li><a href="/auth/logout">Logout</a></li>
<a href="/dashboard" class="text-text-muted hover:text-text transition">Dashboard</a>
<a href="/auth/logout" class="rounded bg-primary px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-hover transition">Logout</a>
{% else %}
<li><a href="/auth/login/forgejo" role="button">Sign in with Forgejo</a></li>
<a href="/auth/login/forgejo" class="rounded bg-primary px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-hover transition">Sign in with Forgejo</a>
{% endif %}
</ul>
</nav>
</nav>
</div>
</header>
<main class="container">
<main class="mx-auto max-w-6xl px-4 py-8">
{% block content %}{% endblock %}
</main>
</body>

View file

@ -3,18 +3,18 @@
{% block title %}Dashboard — Myst{% endblock %}
{% block content %}
<h1>Dashboard</h1>
<p>Welcome, {{ user.display_name or user.email }}!</p>
<h1 class="text-2xl font-bold text-white">Dashboard</h1>
<p class="mt-1 text-text-muted">Welcome, {{ user.display_name or user.email }}!</p>
<section>
<h2>Forgejo Personal Access Token</h2>
<p>Register a <code>read:repository</code>-scoped PAT to enable share link viewing.</p>
<!-- TODO: PAT registration form -->
</section>
<section class="mt-8 rounded-lg border border-border bg-surface-alt p-6">
<h2 class="text-lg font-semibold text-white">Forgejo Access Token</h2>
<p class="mt-1 text-sm text-text-muted">Register a <code class="text-primary">read:repository</code>-scoped PAT to enable share link viewing.</p>
<!-- TODO: PAT registration form -->
</section>
<section>
<h2>Share Links</h2>
<p>You haven't created any share links yet.</p>
<!-- TODO: share link list -->
</section>
<section class="mt-6 rounded-lg border border-border bg-surface-alt p-6">
<h2 class="text-lg font-semibold text-white">Share Links</h2>
<p class="mt-1 text-sm text-text-muted">You haven't created any share links yet.</p>
<!-- TODO: share link list -->
</section>
{% endblock %}

View file

@ -1,13 +1,17 @@
{% extends "base.html" %}
{% block title %}Myst — share Forgejo repositories easily{% endblock %}
{% block title %}Myst{% endblock %}
{% block content %}
<section>
<hgroup>
<h1>Myst</h1>
<p>Share Forgejo repository snapshots via time-limited links.</p>
</hgroup>
<a href="/auth/login/forgejo" role="button">Sign in with Forgejo</a>
</section>
<div class="flex flex-col items-center justify-center py-24 text-center">
<h1 class="text-5xl font-bold text-white">Myst</h1>
<p class="mt-4 text-lg text-text-muted max-w-md">
Share self-hosted repository snapshots via time-limited, view-only links.
</p>
{% if not user %}
<a href="/auth/login/forgejo" class="mt-8 rounded-lg bg-primary px-6 py-3 font-medium text-white hover:bg-primary-hover transition">
Sign in with Forgejo
</a>
{% endif %}
</div>
{% endblock %}

16
web/dev.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
echo "Starting Myst dev server..."
echo " FastAPI: http://localhost:8000"
echo " CSS: watching app/static/css/input.css"
# Start Tailwind CSS watcher in background
./tailwindcss -i ./app/static/css/input.css -o ./app/static/css/output.css --watch &
TW_PID=$!
# Trap to kill tailwind watcher on exit
trap "kill $TW_PID 2>/dev/null" EXIT
# Start uvicorn
uv run uvicorn app.main:app --reload --port 8000