From f6589fddb1f1a5bd2568386323c2f56bb5004fa3 Mon Sep 17 00:00:00 2001 From: Adnaan Date: Tue, 27 Jan 2026 13:00:36 +0100 Subject: [PATCH 1/2] refactor: replace custom CSS with Pico CSS in progressive-enhancement example Replace ~110 lines of custom CSS with Pico CSS framework, keeping only minimal custom styles for: - JS/no-JS mode indicator visibility - Completed todo item styling (strikethrough) - Empty state centering - Todo item flex layout Changes: - Add Pico CSS v2 via CDN - Use semantic HTML elements (
, , , ) - Use Pico's container class for layout - Use Pico's button classes (secondary outline, contrast outline) - Use aria-invalid for form validation errors - Use for helper text and timestamps Co-Authored-By: Claude Opus 4.5 --- .../progressive-enhancement.tmpl | 265 ++++++------------ 1 file changed, 85 insertions(+), 180 deletions(-) diff --git a/progressive-enhancement/progressive-enhancement.tmpl b/progressive-enhancement/progressive-enhancement.tmpl index 04486d9..d03f569 100644 --- a/progressive-enhancement/progressive-enhancement.tmpl +++ b/progressive-enhancement/progressive-enhancement.tmpl @@ -4,195 +4,100 @@ {{.Title}} + -

{{.Title}}

-

This app works with or without JavaScript enabled

- - - -
- JavaScript Mode: Using WebSocket for instant updates without page reloads. - Actions update the page in real-time. -
+
+

{{.Title}}

+

This app works with or without JavaScript enabled

- - {{if .lvt.Flash "success"}} -
{{.lvt.Flash "success"}}
- {{end}} - {{if .lvt.Flash "error"}} -
{{.lvt.Flash "error"}}
- {{end}} - - - - -
-
- - - {{if .lvt.HasError "title"}} -
{{.lvt.Error "title"}}
- {{end}} - -
-
+ + + + JavaScript Mode: Using WebSocket for instant updates without page reloads. + Actions update the page in real-time. + - -
- {{if not .Items}} -
-

No todos yet. Add one above!

-
- {{else}} - {{range .Items}} - {{/* No explicit data-key needed - library auto-generates content-based keys */}} -
- -
- - - -
- {{.Title}} - {{.CreatedAt}} - -
- - - -
-
+ + {{if .lvt.Flash "success"}} + {{.lvt.Flash "success"}} {{end}} + {{if .lvt.Flash "error"}} + {{.lvt.Flash "error"}} {{end}} -
+ + + + +
+
+ + + {{if .lvt.HasError "title"}} + {{.lvt.Error "title"}} + {{end}} + +
+
+ + +
+ {{if not .Items}} +
+

No todos yet. Add one above!

+
+ {{else}} + {{range .Items}} + {{/* No explicit data-key needed - library auto-generates content-based keys */}} +
+ +
+ + + +
+ {{.Title}} + {{.CreatedAt}} + +
+ + + +
+
+ {{end}} + {{end}} +
+