Skip to content

refactor(docs): remove two dead CSS rules - #3099

Merged
Lisa18289 merged 1 commit into
mainfrom
refactor/docs-dead-css-rules
Sep 3, 2026
Merged

refactor(docs): remove two dead CSS rules#3099
Lisa18289 merged 1 commit into
mainfrom
refactor/docs-dead-css-rules

Conversation

@mfal

@mfal mfal commented Sep 2, 2026

Copy link
Copy Markdown
Member

Deletes two apps/docs CSS rules that match nothing in the rendered DOM. No
rendering change — verified, see below.

Follow-up from the selector-max-type triage in #3091, where these three
warnings were disabled rather than changed, because switching them to a class
selector would have activated them.

1. .mainContent > h3, > h4 { margin-top } — obsolete

apps/docs/src/app/layout.module.scss

Live until #2573 wrapped the MDX output in <div style="display: contents">.
display: contents removes the box from layout but not from the DOM, so the
child combinator stopped matching and the extra spacing silently disappeared.

#2870 ("docs: fix heading spacing") fixed that at the heading instead:

.anchorLinkHeading {
  &h3 { margin-top: var(--section--sub-heading-spacing-m); }
}

That is what puts 24px above every MDX ## today. The layout rule has been
redundant 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 applied

apps/docs/src/app/_components/layout/Header/Header.module.scss

A styles import/class mismatch, dead since the day it was written. #2338 put
the class in Header.module.scss, but its only consumer,
MobileNavigation.tsx, imports @/app/layout.module.scss — which has no such
key. styles.mobileNavigationOffCanvas was undefined, so React dropped the
className. Next types CSS modules as { [key: string]: string }, so nothing
flagged 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" — Section headings from
MainNavigation. Hiding them would drop the labels but keep the
expand-all/grouping buttons that sit on the "Components" header row, leaving two
unlabelled icon buttons. "Menü" is an h2 and unaffected. No indication UX wants
this; the desktop navigation shows the same headings.

Verification

Ran the docs app and inspected the live DOM (pnpm nx dev docs), plus the
prerendered output of pnpm nx build docs.

Check Result
.mainContent > h3, > h4 matches 0 — headings sit in the display: contents wrapper (11 h3/h4 as grandchildren)
h3 computed margin-top 24px, before and after — from .anchorLinkHeading&h3
.mobileNavigationOffCanvas in the document absent — off-canvas root is div.flow--overlay.flow--modal--off-canvas
Mobile menu at 900px, before vs. after Identical
stylelint on both files 3 selector-max-type warnings → 0
pnpm lint, pnpm nx build docs Pass

No visual test snapshots are involved — this is docs layout, not
packages/components.

For UX — not changed here

MDX ### renders as a plain Heading level={4} with no top margin (only the
16px 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

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>
@mfal
mfal requested a review from a team September 2, 2026 12:09
@mfal mfal self-assigned this Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6582 for commit 5a21bce by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3099.docs.review.flow-components.de
storybook pr-3099.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3099
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3099

@mfal
mfal requested a review from Lisa18289 September 2, 2026 13:01
@Lisa18289
Lisa18289 merged commit cfb5d9a into main Sep 3, 2026
22 checks passed
@Lisa18289
Lisa18289 deleted the refactor/docs-dead-css-rules branch September 3, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants