luci-theme-footstrap: simplify uci-defaults, add the OpenWrt 2020 colourway - #8959
Merged
Conversation
The script registered the theme and then cleaned up after every version of it that ever shipped: eight legacy theme names, four legacy media paths, the old top-bar layout carried into luci.main.footstrap_layout, two downloaded wallpapers, a pre-0.12.1 fonts/ directory, a fallback to bootstrap when the active theme's files were missing, /etc/config/footstrap creation that the shipped conffile already covers, and a marker file to tell a fresh install from an upgrade. All of it served installs that predate the version merged into this tree. OpenWrt expects a sysupgrade rather than a package upgrade, so file leftovers go with the image, and the cleanup worth doing is config. What is left is the registration, the three symlinks that expose the admin's uploads out of /etc, and the same fresh-vs-upgrade rule the other themes here use: mediaurlbase is written only in the run that first added luci.themes.Footstrap. postrm loses the same eight-name list, the layout key and the marker directory. Behaviour was compared with the old script on 25.12/apk and 24.10/opkg: a fresh install with a theme already chosen registers and does not switch, an upgrade changes nothing, a fresh install with no mediaurlbase activates the theme, a second run in the same install is a no-op, postrm "upgrade" changes nothing and postrm "remove" hands the UI back to bootstrap. Signed-off-by: Ivan Kvashonkin <vizzlef@gmail.com>
luci-theme-openwrt-2020 is one colour scheme and no dark mode: the CI cyan #00B5E2 on the navy #002B49, white content, and #5CB85C / #CC8800 / #CC1111 for the semantic three. This adds that identity to footstrap as a palette, which is the form suggested in the discussion on openwrt#8903 for keeping the look if the theme itself is retired. The pair splits the work along the reason it exists. Dark IS 2020's own scheme — the navy is the canvas and the cyan is nearly untouched. Light keeps the hue and darkens it, because #00B5E2 measures 2.09:1 on white, and every level of this theme's exported colour tier has to pass WCAG AA as text on all three surfaces: apps read those names as color: about as often as background:. The semantic three move for the same reason — on white 2020's green is 2.28:1 and its amber 3.42:1 — while its red at 5.25:1 is kept where it was. The palette is registered in the four places the theme requires: the palette axis in fs-prefs.js, the server-default whitelist and the pre-paint switch in partials/head.ut, and the label in fs-appearance.js. It is opt-in through Appearance; nothing changes for anyone who does not pick it. Contrast was measured across the whole matrix rather than by eye: 56 palette x mode x tint combinations, 4352 checks, every level clear of AA on background, panel and panel2, and every ink clear on the fill it sits on. axe-core reports no serious or critical violations on the widget gallery in either mode. Signed-off-by: Ivan Kvashonkin <vizzlef@gmail.com>
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.
Two follow-ups after the merge of #8903, kept in one PR as two separate commits.
1.
luci-theme-footstrap: simplify uci-defaults— @hnyman asked for this in review: start from the assumption that a user of the official package started at the version in this tree. The script is 36 lines instead of 162. Gone: eight legacy theme names, four legacy media paths, the old top-bar layout carried intoluci.main.footstrap_layout, two downloaded wallpapers, a pre-0.12.1fonts/directory, a fallback to bootstrap when the active theme was missing its files,/etc/config/footstrapcreation that the shipped conffile already covers, and a marker file that told a fresh install from an upgrade.postrmloses the same list and the marker.What is left is the registration, the three symlinks that expose the admin uploads out of
/etc, and the fresh-vs-upgrade rule the other themes here use —mediaurlbaseis written only in the run that first addedluci.themes.Footstrap.Behaviour was compared with the old script on 25.12/apk and 24.10/opkg: a fresh install with a theme already chosen registers and does not switch; an upgrade changes nothing; a fresh install with no
mediaurlbaseactivates the theme; a second run in the same install is a no-op;postrm upgradechanges nothing andpostrm removehands the UI back to bootstrap.2.
luci-theme-footstrap: add the OpenWrt 2020 colourway as a palette— the shape @jow- suggested in the same discussion for keeping that look ifluci-theme-openwrt-2020is retired: its CI cyan#00B5E2on the navy#002B49as a palette here, opt-in through Appearance and changing nothing for anyone who does not pick it.Dark mode is 2020s own scheme, navy canvas and the cyan nearly untouched. Light keeps the hue and darkens it, because
#00B5E2is 2.09:1 on white and every level of the theme exported colour tier has to clear WCAG AA as text on all three surfaces. Measured across 56 palette x mode x tint combinations, 4352 checks, all clear; axe-core reports no serious or critical violations on the widget gallery in either mode.