schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs and SSR.
https://jasprpad.schultek.de
MIT License
996 stars 59 forks source link

feat: Attributes at the <html> tag level #241

Open dinko7 opened 1 month ago

dinko7 commented 1 month ago

Description

In my current setup, I'm only using Document.template with an index.html because there's currently no way to set attributes at <html> level. Here's what I'd want to have as an output:

<html data-theme="dark">.

A good solution would be to be able to provide a Map, similar to how Styles.raw allows for any attribute to be added to most Components. That way, anybody could manipulate these properties. A simple use case for this is changing the data-theme from dark to light.

schultek commented 1 month ago

This is only for ssr, or do you want to change this value during client rendering?