This is a rough draft of a specification for "theme packs" geared towards Lagrange, but they can be reused by other apps as well.
A Themepack file:
A Themepack ZIP pack:
Once a themepack is downloaded, the downloaded copy alone should be used. Don't look it up again unless the user prompts it. (Your client may remember where a themepack was downloaded from, so that you can "check for updates" from within your client.)
A themepack can be automatically applied if all of the following conditions are true upon clicking a link:
If a themepack cannot be automatically applied, confirmation should be gathered before applying the theme pack. The user should be warned of the domain, site name, and the presence of each feature (menubar, colors, fonts, etc). If there are any external resources referenced, each one should be warned for, and persisted alongside the themepack (so it does not get re-fetched except during manually-triggered updates). The confirmation page should also include (a way to view) the actual TOML file itself.
After automatically applying a themepack, the page it was linked to on should be restyled immediately, but not reloaded.
When following a link to a themepack which is already loaded and up to date, if possible, a client should navigate to the confirmation page anyway.
If this is omitted, it CANNOT be automatically applied. This may be useful to add global themes in the future but this spec is not built to handle that case.
The domain prefix MUST include the hostname that it applies to. If no scheme (i.e. spartan://) is provided, Gemini should be assumed as the default. If no port is provided, it should be assumed to be the default port of the scheme used (so, 1965 by default). Finally, if no path is provided, the theme applies to the entire site, EXCEPT areas with more specifically applied themes or "user" areas (Lagrange considers at least /users/ and /~... prefixes).
A bookmark icon will override this. Additionally, unlike bookmark icons, this applies to the "domain" of the site only, instead of the entire site.
This option is chiefly intended for Lagrange and Lagrange-like clients like Profectus.
Primary, accent/secondary, and tertiary for good measure.
This does not guarantee your exact chosen color will appear, but the greatest chance for that lies with the primary color.
This section defines a menubar. I don't know if this will ever be used, but a man can dream.
Keys (names) are the displayed link names, and the values are the link destinations. Offsite or off-"domain" links may show icons, even if the links don't by default.
Extra whitespace within link names should be minimized to make menubar links more distinct from each other. When a site menubar is displayed, the focus is put after the menubar by default. There should be a shortcut for accessing the site menubar.
Instead of a menubar, this can be implemented as an in-site sidebar or a client sidebar, as you wish.
TODO