icon component
macro, Tailwind with @apply, and Vite’s hot reload.
Create the project
simple app with no database is all this part needs. Background jobs cost nothing at
the default, since the thread backend requires no Redis.
Step 1: The project structure
Step 2: The board route
Replaceroutes/pages/home.py:
routes/pages/home.py
Step 3: The board template
Createtemplates/pages/board.html:
templates/pages/board.html
Step 4: The CSS
Add this tostatic/css/app.css, after the existing content:
static/css/app.css
Why not utility classes in the markup?
Why not utility classes in the markup?
Feather prefers CSS classes with
@apply. Templates stay readable, styles get reused
across templates, and a restyle happens in one file rather than twenty. feather check
reports utility classes in markup as the inline-tailwind warning.How dark mode works here
How dark mode works here
Every colour-related
@apply carries a dark: variant. The scaffolded base.html
loads Feather’s dark-mode.js, which toggles a .dark class on <html> when anything
with data-toggle-dark-mode is clicked.The toggle button holds two icon spans, icon-light and icon-dark, and CSS decides
which is visible. No custom JavaScript.Step 5: Run it
- Change a column title in
home.py, and watch the browser reload. - Change a colour in
app.css, and watch it update without a reload.
Prompt Claude
Run this from inside thekanban directory after scaffolding.
Checkpoint
You’re done when:- Three columns render, each with its cards
- The page is styled in both light and dark mode
- The toggle in the header switches between them
- Material icons render on the header and the buttons
feather checkpasses
Files you touched
What you learned
- Scaffolding a project with
feather new - Template inheritance with
extendsandblock - Importing and calling component macros
- The
iconmacro and its sizes - Writing Tailwind as
@applyclasses instead of markup utilities - Dark mode through
dark:variants - Jinja2 loops, including the
{% else %}branch for an empty list
Next: make it persist
Add models, migrations and services, then wire the buttons up with HTMX.