Skip to content

fix(sidebar): avoid empty span #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2025
Merged

fix(sidebar): avoid empty span #253

merged 2 commits into from
Jun 19, 2025

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Jun 18, 2025

Description

Avoids empty spans in the sidebar.

Motivation

Noticed empty <span></span> on https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook (in the <li> following the Layout cookbook link in the sidebar), after adding padding in mdn/fred@6befb4f.

Additional details

Visually noticable here: https://fred.review.mdn.allizom.net/en-US/docs/Web/CSS/Layout_cookbook

Related issues and pull requests

@caugner caugner requested a review from fiji-flo June 18, 2025 15:56
@caugner caugner force-pushed the avoid-empty-span branch from 4d95fb3 to 4eab947 Compare June 18, 2025 16:10
@fiji-flo
Copy link
Contributor

I think we should ask whether to change this in the cssref sidebar:

It's currently:

  - type: section
    link: /Web/CSS/Layout_cookbook
  - children:
      - /Web/CSS/Layout_cookbook/Media_objects
      - /Web/CSS/Layout_cookbook/Column_layouts
      - /Web/CSS/Layout_cookbook/Center_an_element
      - /Web/CSS/Layout_cookbook/Sticky_footers
      - ...

But maybe we want:

  - type: section
    link: /Web/CSS/Layout_cookbook
    children:
      - /Web/CSS/Layout_cookbook/Media_objects
      - /Web/CSS/Layout_cookbook/Column_layouts
      - /Web/CSS/Layout_cookbook/Center_an_element
      - /Web/CSS/Layout_cookbook/Sticky_footers
      - ...

Anyhow there's use cases for having children without title so let's fix this. I just refactored it a tiny bit.

@caugner caugner merged commit ba2e792 into main Jun 19, 2025
4 checks passed
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