Skip to content
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

Display/alignment issues with collapsible "MDN Baseline alert" boxes #2419

Open
ZStoner opened this issue Jan 30, 2025 · 0 comments
Open

Display/alignment issues with collapsible "MDN Baseline alert" boxes #2419

ZStoner opened this issue Jan 30, 2025 · 0 comments
Labels

Comments

@ZStoner
Copy link

ZStoner commented Jan 30, 2025

Bug report

Overview:

  • When viewing docs sourced from MDN that have a "Baseline Alerts" box at the top (like CSS/HTML docs), the style formatting of the <details>/<summary> tags could use some improvements.
  • Recently I noticed that the styling used for the Baseline Alerts box now has shading and a border. Nice. 👍
    • But, I still see the collapsible arrow widget is not lined up with its text, regardless if Closed (▶︎) or Opened (▼︎)

OS information

  • Windows 11: Chrome and Edge.
  • Windows 10: Chrome, Edge and Firefox.

Steps to reproduce

  1. Navigate to a DevDocs page that was sourced from MDN and contains a "Baseline Alert" box.
  2. Observe the collapsed "Baseline" alert box at the top of the page. {State:Closed (▶︎)}.
    • Note the placement of the Expand/Collapse widget in relation to the "Baseline widely available" heading.
  3. Click the widget to expand the box. {State:Opened (▼︎)}.
    • Again note the placement of the widget with respect to the "Baseline..." heading text.
  4. Ideally the <details>/<summary> text should be alongside the widget glyph.
    • Using the F12 DevTools, I see that the actual text is wrapped in an <H2> header tag with no special handling, but <H2> is generally a block element, not inline.

More resources

Here's snippets showing the current layout issues of the Baseline alert boxes...

Default: Closed Default: Opened
Image Image

Possible fix

If the following (or equivalent) CSS Style changes were made, it could look and behave much better:

  • details { padding-left: 10px; }
    • This adds a small padding buffer next to the widget.
  • summary > h2 { display: contents; }
    • This removes the "block" state for <h2> when within a <summary> tag and places the text next to the glyph.
    • Both display:inline or display:contents works here... I'll let the team decide what's best.

If applied, it would look similar to this...

Proposed: Closed Proposed: Opened
Image Image
@ZStoner ZStoner added the bug label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant