diff --git a/scripts/check-mega-menu.mjs b/scripts/check-mega-menu.mjs index df19588..a60d387 100644 --- a/scripts/check-mega-menu.mjs +++ b/scripts/check-mega-menu.mjs @@ -18,7 +18,15 @@ * while a panel is open; the collapsed layout is left alone. * 4. Docs. Every `--mm-*` the stylesheet reads is in the component header and the catalogue's * theming list, except what the script itself sets; every catalogue variable is read. - * 5. Mutations. Each check runs against deliberately broken copies and must fail on every one. + * 5. No shift. Below the breakpoint the served page is already folded where the script will fold + * it: the frontmatter's `// ` block is run for several breakpoints and must give + * one `(scripting: enabled)` rule at the script's own matchMedia threshold, keyed on that + * breakpoint, that shows the Menu button and folds the list; the built nav opens with it. The + * Menu button is not served `hidden` and the script never unhides it; only the collapsed layout + * hides the list; a panel item's link carries its button's caret and both are border-box, so + * the swap above the breakpoint keeps the bar's width; a collapsed menu is set up when its script + * is reached, asking the same question as the stylesheet. + * 6. Mutations. Each check runs against deliberately broken copies and must fail on every one. * * Exits 1 with one line per failure. */ @@ -54,7 +62,8 @@ const html = readFileSync(pagePath, 'utf8'); const squash = (s) => s.replace(/\s+/g, ' ').trim(); const esc = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); const logicBlock = (code) => code.match(/\/\/ \n([\s\S]*?)\/\/ <\/mm-fit>/)?.[1] ?? null; -const styleOf = (code) => code.match(/