← Back to context

Comment by jcgl

12 hours ago

Sure, for the most static of static sites. But without JavaScript you can’t even do basic things client-side, such as having some variable-length list of fields in a form. Or customized field validation.

If such client-side behavior counts as “basically an application,” then “applications” is a larger set than seems useful.

Theme switchers! My favorite example of why "document-only" sites might need JS. Sure, you can use @media prefers-color-scheme for defaults, and you can do checkbox/radio shenanigans to make it switchable, but there's no way to persist that preference on a static site without JS.

If you don't care about your site being static then you can track it server side, but that has big implications for his you can just your site. Sticking a little flag in localStorage really is the best solution, if you can get past ideological purity.