Repository navigation
feat: plugin theme roles, meters, ornaments, clumps, and manifest version 2 - #240
Merged
Merged
Conversation
…sion 2
Plugins: the theme message (version 2) adds role tokens, named for what a
thing does: surfaces and text, status colors, radii, type and meters. The
SDK writes them onto the plugin's root after checking them as theme tokens
are checked, and registers the theme's fonts from its own installed folder,
so plugin CSS written against var(--text) or var(--hg-meter-fill) follows
every theme. Version 1 plugins are unaffected. A test holds the SDK's role
list equal to the dashboard's.
Meters: --hg-meter-track, -fill, -thickness and -cap. Classic's values are
the refresh countdown's current look, which now draws from them.
Ornaments: a theme may list pictures from its folder anchored to a frame's
corners, edges or center (`corners` mirrors one picture into all four).
Every widget frame draws them, native and plugin alike, as a still layer
with no pointer events. A theme makes room with --hg-frame-inset, now
capped at 24px a side; plugins already sit inside that inset.
Clumps: a sprite layer can gather its copies into patches with open
ground between (`clumps`, `clumpWidth`), as kelp grows from holdfasts.
Twinkles shrink as they fade, so dim means small, as in a still starfield.
Manifest version 2: themes can now be installed, so a shape change needs a
version (theme-architecture.md §5). Version 2 adds ornaments, meters and
clumps. A theme too new for a core says so plainly and in every language
("Starship needs a newer version of HomeGlow. Update HomeGlow to use
it."), in the store list in place of Install, on a folder upload, and for
an installed theme; the version numbers go to the console and server log.
Also: the Classic token test compares paths with forward slashes, so it
passes on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #218
Follow-up to the theme work (#239): plugins that follow the theme, meters, ornaments, clumps, and a manifest version for them.
Plugins follow the theme. The theme message (now version 2) carries role tokens, named for what a thing does rather than how one theme draws it:
--background,--surface,--card-bg,--text,--text-secondary,--border--success,--warning,--hg-error--hg-radius-sm,-md,-lg--hg-font-body,--hg-font-heading,--hg-heading-transform,--hg-heading-letter-spacing--hg-meter-track,-fill,-thickness,-capThe SDK checks them like theme tokens and writes them onto the plugin's root, and registers the theme's fonts from its installed folder. Plugin CSS written against
var(--text)then follows every theme. Version 1 plugins are unaffected, and a test keeps the SDK's list equal to the dashboard's. The plugin guide has the details.Meters. Four role tokens for anything that shows a level or progress. Classic's values are today's refresh countdown, which now draws from them, so nothing changes until a theme sets its own.
Ornaments. A theme can list pictures from its folder anchored to a frame's corners, edges or center (
cornersmirrors one picture into all four). Every widget frame draws them, native and plugin alike, as a still layer with no pointer events. Themes make room with--hg-frame-inset, now capped at 24px a side; plugins already sit inside it.Clumps. A sprite layer can gather its copies into patches with open ground between (
clumps,clumpWidth), the way kelp grows from holdfasts. Without it, copies spread evenly as before.Twinkles shrink as they fade, so dim means small, as in a still starfield.
Manifest version 2. Themes can be installed now, so per §5 of the architecture doc a shape change gets a version. Version 2 adds ornaments, meters and clumps. A theme too new for a HomeGlow says so plainly, translated: "Starship needs a newer version of HomeGlow. Update HomeGlow to use it." That shows in the store list in place of Install, on a folder upload, and for an installed theme. The version numbers go to the console and server log.
Also: the Classic token test compares paths with forward slashes, so it passes on Windows (reported on #237).
Reef and Starship 1.1.0 use all of this: kelp forests that grow in clumps, porthole-bolt ornaments and meters on Reef, meters and finer stars on Starship. I'll publish them to HomeGlowThemes once this merges.
Tested: client and server tests, i18n check and build; in a browser, ornaments on every frame in light and dark, meters, and three plugins receiving all role tokens and theme fonts. Running in our production install.