test(styles): regression test for markdown max-width (#1452)#1519
Open
JoseRodriguez26 wants to merge 1 commit into
Open
test(styles): regression test for markdown max-width (#1452)#1519JoseRodriguez26 wants to merge 1 commit into
JoseRodriguez26 wants to merge 1 commit into
Conversation
…1452) Guards against the tutorial-layout regression (processing#1452) where an invalid `@reference <utility>;` silently dropped the max-width cap on rendered markdown, collapsing tutorial pages (e.g. /tutorials/intro-to-glsl/) into an unreadable vertical column. The test compiles styles/markdown.scss with sass and asserts the width cap exists, equals $breakpoint-tablet, that .full-width opts out wider, that no stray @reference survives compilation, and that no `@reference <utility>;` exists in source (guarding the whole bug class). Also adds ISSUE-1452-WRITEUP.md documenting the root cause and timeline. Co-authored-by: julian-men <ianmenjones@gmail.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Summary
Adds a regression test guarding against the tutorial-layout bug reported in #1452, where the GLSL tutorial (
/tutorials/intro-to-glsl/) — and other rendered-markdown pages — collapsed into a thin, unreadable vertical column of text.The bug itself is already fixed (by #1457). This PR does not re-fix it; it adds the missing guardrail so the bug — and its whole class — cannot silently return, and documents the root cause so the "it broke then healed itself" mystery is explained.
Co-authored with @julian-men.
Root cause & timeline (answers "why did it break ~2 weeks ago but not today?")
The width cap on
.rendered-markdown > *instyles/markdown.scssis what keeps tutorial text at a readable column width.@apply max-w-screen-md;@reference max-w-screen-md;max-width: variables.$breakpoint-tablet;adb24d3e4"Upgrade Astro to v6" (a large upgrade, almost certainly an automated codemod) rewrote@apply max-w-screen-md;→@reference max-w-screen-md;. In Tailwind v4,@referenceis only valid pointing at a file (@reference "app.css";); pointed at a utility name it is invalid and silently dropped by the browser — no error. The max-width cap vanished and the layout collapsed. This is Shader tutorial continues to have vertical text problem on beta #1452.3ed344be6"Fix tutorial content too wide" (Tutorial content too wide #1457) replaced the broken line withmax-width: variables.$breakpoint-tablet;. That PR targeted a different symptom (content too wide) and healed Shader tutorial continues to have vertical text problem on beta #1452 as a side effect — which is why the fix was never connected to this issue.What this PR adds
test/styles/markdown-scss.test.ts(Vitest, 5 tests). It compilesstyles/markdown.scsswithsassand asserts:max-width(not missing/zero).$breakpoint-tablet..full-widthcorrectly opts out to a wider limit.@referencesurvives into the compiled CSS.styles/+src/fails on any@reference <utility>;— guarding the whole bug class, not just this one line.Also includes
ISSUE-1452-WRITEUP.mdwith the full root-cause writeup (happy to move or drop this if maintainers prefer it not live in the repo).Verification
Closes #1452 (adds regression coverage; fix already landed in #1457).