Skip to main content

max / makenotwork

Answer the chrome-style question: it stays inline, and prove why The premise was that inlining is what stops creator CSS restyling platform chrome, so a cascade layer might replace it. Neither half holds. The guarantee is structural. css_sanitizer.rs re-emits every creator rule nested inside .user-canvas#uc-{owner}, and the header and footer are siblings of that canvas, so a rule naming .mnw-chrome is emitted under the canvas and matches nothing. Specificity and layers never enter into it. platform_chrome_is_unreachable_from_creator_css demonstrates this over eight escape attempts, including the universal selector and selectors prefixed with html, body and :root. And there is no layer to join. The custom/*.html pages are standalone documents that never go through shell.rs, link no stylesheet, and never emit the @layer statement. Moving the block into style.css would pull the whole platform sheet onto every creator page and put every platform class in scope on the surface built for creator control. Reason recorded next to the block, as the task asked.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-08-17 00:35 UTC
Signed with PGP, not checked
Commit: b30ad28fa83468d76565d58cccb09aba748b7dc3
Parent: c635865
2 files changed, +59 insertions, -1 deletion
@@ -781,6 +781,40 @@
781 781 assert!(!out.contains("} body{"));
782 782 }
783 783
784 + #[test]
785 + fn platform_chrome_is_unreachable_from_creator_css() {
786 + // The guarantee behind `templates/custom/_chrome_style.html`. The header
787 + // and footer are siblings of the canvas, not descendants, so a creator
788 + // rule that names them is still emitted under the canvas and matches
789 + // nothing. This holds by structure, not by specificity or cascade layer,
790 + // which is why the chrome block needs no !important and no layer of its
791 + // own.
792 + const CANVAS: &str = ".user-canvas#uc-11111111-1111-1111-1111-111111111111";
793 + for attempt in [
794 + ".mnw-chrome { display: none }",
795 + ".mnw-chrome { background: red }",
796 + ".mnw-chrome-footer a { color: red }",
797 + "body .mnw-chrome { background: red }",
798 + "html body .mnw-chrome-brand { font-weight: 100 }",
799 + "* { background: red }",
800 + ":root .mnw-chrome { background: red }",
801 + ".mnw-chrome-actions, .mnw-chrome-brand { visibility: hidden }",
802 + ] {
803 + let out = scoped(attempt);
804 + for line in out.lines().filter(|l| l.contains(".mnw-chrome")) {
805 + assert!(
806 + line.contains(CANVAS),
807 + "a chrome selector escaped the canvas: {line}\nfrom: {attempt}"
808 + );
809 + }
810 + // Nothing may be emitted at the top level of the sheet.
811 + assert!(
812 + !out.trim_start().starts_with(".mnw-chrome"),
813 + "unscoped chrome rule from: {attempt}"
814 + );
815 + }
816 + }
817 +
784 818 #[test]
785 819 fn idempotent_on_sanitized_output() {
786 820 let once =
@@ -1,7 +1,31 @@
1 1 <style>
2 2 /* Platform chrome for custom pages. Lives outside the user canvas, so creator
3 3 CSS (scoped to .user-canvas / .item-canvas) can never restyle or hide it.
4 - Deliberately minimal and theme-independent. */
4 + Deliberately minimal and theme-independent.
5 +
6 + STAYS INLINE. Asked and answered 2026-08-16.
7 +
8 + The guarantee is structural, not a cascade contest. css_sanitizer.rs
9 + re-emits every creator rule nested inside .user-canvas#uc-{owner}; the
10 + header and footer are siblings of that canvas, so a creator selector
11 + naming .mnw-chrome is emitted under the canvas and matches nothing. No
12 + specificity, layer or !important is involved, which is why this block
13 + needs none. Demonstrated by css_sanitizer.rs's
14 + platform_chrome_is_unreachable_from_creator_css, which walks eight escape
15 + attempts including `*`, `html body .mnw-chrome-brand` and `:root`.
16 +
17 + So a cascade layer would buy nothing here, and these pages have none to
18 + join: custom/*.html are standalone documents that do not go through
19 + shell.rs, link no stylesheet, and never emit the `@layer makeover, base,
20 + components, responsive` statement. Moving these lines into style.css
21 + would pull the whole platform sheet onto every creator page and put every
22 + platform class in scope on the one surface built for creator control.
23 +
24 + A separate linked chrome.css would be cacheable, and is still not worth
25 + it: ~1.3KB against a second request, and a fetch that fails leaves the
26 + chrome unstyled while the creator's inline CSS still renders. Inline
27 + cannot fail that way. Revisit only if this block grows past the point
28 + where its bytes beat the round trip. */
5 29 html, body { margin: 0; padding: 0; }
6 30 body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
7 31 .mnw-chrome, .mnw-chrome-footer {