refactor(docs): remove two dead CSS rules - #3099
Merged
Merged
Conversation
Both matched nothing in the rendered DOM. Verified against the running
docs app and the built output; removing them changes no pixel.
`.mainContent > h3, > h4 { margin-top }` (layout.module.scss) was live
until #2573 wrapped the MDX output in `<div style="display:contents">`.
`display: contents` drops the box from layout but not from the DOM, so
the child combinator stopped matching and the spacing silently went
away. #2870 fixed that at the heading itself —
`.anchorLinkHeading&h3 { margin-top: var(--section--sub-heading-spacing-m) }`
— which is what delivers the 24px above every MDX `##` today. The layout
rule has been redundant since.
`.mobileNavigationOffCanvas h3 { display: none }` (Header.module.scss)
never applied at all. #2338 added the class to Header.module.scss, but
its only consumer, MobileNavigation.tsx, imports `layout.module.scss` —
which has no such key, so `styles.mobileNavigationOffCanvas` was
`undefined` and React dropped the className. Removed the dangling
reference and the then-unused import along with the rule. Activating the
rule today would be a regression: it would hide the "Components" and
"Integrations" labels in the mobile menu while leaving their
expand-all/grouping buttons on a naked header row.
Clears the three `selector-max-type` warnings that #3091 had to disable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Coverage Report for ./packages/components/
File CoverageNo changed files found. |
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
Lisa18289
approved these changes
Sep 3, 2026
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.
Deletes two
apps/docsCSS rules that match nothing in the rendered DOM. Norendering change — verified, see below.
Follow-up from the
selector-max-typetriage in #3091, where these threewarnings were disabled rather than changed, because switching them to a class
selector would have activated them.
1.
.mainContent > h3, > h4 { margin-top }— obsoleteapps/docs/src/app/layout.module.scssLive until #2573 wrapped the MDX output in
<div style="display: contents">.display: contentsremoves the box from layout but not from the DOM, so thechild combinator stopped matching and the extra spacing silently disappeared.
#2870 ("docs: fix heading spacing") fixed that at the heading instead:
That is what puts 24px above every MDX
##today. The layout rule has beenredundant since.
Note
#3091's comment on this rule has the reasoning backwards — "the child
combinator is load-bearing … only headings rendered directly here match".
Because the MDX view wraps its output, none match.
2.
.mobileNavigationOffCanvas h3 { display: none }— never appliedapps/docs/src/app/_components/layout/Header/Header.module.scssA
stylesimport/class mismatch, dead since the day it was written. #2338 putthe class in
Header.module.scss, but its only consumer,MobileNavigation.tsx, imports@/app/layout.module.scss— which has no suchkey.
styles.mobileNavigationOffCanvaswasundefined, so React dropped theclassName. Next types CSS modules as{ [key: string]: string }, so nothingflagged it.
Also removed the dangling reference and the import that became unused with it.
Activating the rule today would be a regression. In the off-canvas menu the
two
h3s are "Components" and "Integrations" —Sectionheadings fromMainNavigation. Hiding them would drop the labels but keep theexpand-all/grouping buttons that sit on the "Components" header row, leaving two
unlabelled icon buttons. "Menü" is an
h2and unaffected. No indication UX wantsthis; the desktop navigation shows the same headings.
Verification
Ran the docs app and inspected the live DOM (
pnpm nx dev docs), plus theprerendered output of
pnpm nx build docs..mainContent > h3, > h4matchesdisplay: contentswrapper (11h3/h4as grandchildren)h3computedmargin-top.anchorLinkHeading&h3.mobileNavigationOffCanvasin the documentdiv.flow--overlay.flow--modal--off-canvasstylelinton both filesselector-max-typewarnings → 0pnpm lint,pnpm nx build docsNo visual test snapshots are involved — this is docs layout, not
packages/components.For UX — not changed here
MDX
###renders as a plainHeading level={4}with no top margin (only the16px
row-gap); 5 content files use it. The deleted rule wanted 16px there, but#2870 deliberately moved h3 to the Flow scale, where the h4 counterpart is
--section--sub-heading-spacing-s(8px), not 16px. Picking a value is UX's call,so this PR leaves it alone.
Note for #3091
Once this lands, #3091 can drop both of its disable blocks — the warnings are
gone with the rules.
related #3091, #3021
🤖 Generated with Claude Code