setup: flex-ify, light/dark, keep page position on reload

got rid of a bunch of m[l/r/x/y]-x tailwind classes and used more
flex-[row/col] gap-2's. UI should be more consistent in general, and
with the admin UI.

The page you were on is actually read from the URL on reload, however
does not keep settings (implemented just for ease of UI editing,
really).

`missing-colors.js` preprocessor script now applies dark prefixes for
<section>s, but like with cards, does not apply a default ~neutral to
those without, so that <section class=""> looks different to <section
class="~neutral">.

Light/dark selector added to setup too, and the actual mode given to the
browser through CSS `color-scheme` is correct, meaning things like textareas, checkboxes and
controls are now colored according to the theme.
This commit is contained in:
Harvey Tindall
2024-08-21 16:13:17 +01:00
parent e5f79c60ae
commit 2057823b7a
6 changed files with 577 additions and 485 deletions

View File

@@ -33,7 +33,7 @@ function fixHTML(infile, outfile) {
}
}
let doc = new parser.load(f);
for (let item of ["badge", "chip", "shield", "input", "table", "button", "portal", "select", "aside", "card", "field", "textarea"]) {
for (let item of ["badge", "chip", "shield", "input", "table", "button", "portal", "select", "aside", "card", "field", "textarea", "section"]) {
let items = doc("."+item);
items.each((i, elem) => {
let hasColor = false;
@@ -50,8 +50,8 @@ function fixHTML(infile, outfile) {
}
if (!hasColor) {
if (!hasDark(doc(elem))) {
// card without ~neutral look different than with.
if (item != "card") doc(elem).addClass("~neutral");
// card (and sections in sectioned cards) without ~neutral look different than with.
if (item != "card" && item != "section") doc(elem).addClass("~neutral");
doc(elem).addClass("dark:~d_neutral");
}
}