Skip to content

fix(core/caniuse): mark up browser support groups as a dl - #5282

Open
marcoscaceres wants to merge 2 commits into
mainfrom
fix/4090-caniuse-grid
Open

fix(core/caniuse): mark up browser support groups as a dl#5282
marcoscaceres wants to merge 2 commits into
mainfrom
fix/4090-caniuse-grid

Conversation

@marcoscaceres

@marcoscaceres marcoscaceres commented May 9, 2026

Copy link
Copy Markdown
Contributor

Closes #4090

The browser support groups were nested <div>s; they are now a <dl> with a <dt> label and <dd> of browser cells per group, which is what the issue asked for and reads better to assistive technology. The existing flex layout and its legend-on-a-rule look are kept as-is, and on narrow screens the groups stack full width with the "More info" link on its own row.

Not switched to CSS grid, despite the issue suggesting it: the flex layout already produced the intended appearance, and several grid rewrites each regressed it (misaligned group labels, the rule striking through the label text, pills scattered across columns). Two rendering bugs found along the way are fixed here too. The "More info" link carried caniuse-cell, which sets white text with a background gradient built from a variable only defined on the support-level classes, so it rendered white on white; and the group labels used var(--bg, white), but --bg is not defined anywhere in ReSpec, so they painted a white patch on dark-mode pages.

Written with AI: this change was generated by Claude. Per AI_POLICY.md.

@marcoscaceres
marcoscaceres force-pushed the fix/4090-caniuse-grid branch from dddb892 to 54a01af Compare May 14, 2026 15:22
@marcoscaceres marcoscaceres added the AI Contains AI-generated logic; see AI_POLICY.md label Aug 5, 2026
@marcoscaceres
marcoscaceres requested a balanced review from Copilot August 11, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reworks Can I Use output with semantic definition-list markup and responsive CSS Grid layout.

Changes:

  • Uses dl/dt/dd markup for browser groups.
  • Moves “More info” onto its own row.
  • Updates styles and tests for the new structure.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/core/caniuse.js Generates semantic grouped markup.
src/styles/caniuse.css.js Adds responsive grid layout.
tests/spec/core/caniuse-spec.js Updates selectors and expectations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/spec/core/caniuse-spec.js Outdated
Comment on lines +227 to +228
expect(desktop.querySelector(".caniuse-type").textContent).toBe("desktop");
expect(mobile.querySelector(".caniuse-type").textContent).toBe("mobile");
@marcoscaceres
marcoscaceres force-pushed the fix/4090-caniuse-grid branch from 84ad0fe to c1b79fa Compare August 18, 2026 07:48
@marcoscaceres marcoscaceres changed the title fix(core/caniuse): use dl markup and CSS Grid layout fix(core/caniuse): mark up browser support groups as a dl Aug 18, 2026
@marcoscaceres
marcoscaceres requested a balanced review from Copilot August 18, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/styles/caniuse.css.js:87

  • The dark-mode label bug described by this PR is still present. Elevating the label above the rule does not change the unchanged background-color: var(--bg, white) below; because --bg is never defined, dark-mode pages still get a white patch. Use the color-scheme-aware canvas color as the fallback/background.
  /* Above the dd's border, so the label's background breaks the rule instead
     of the rule striking through the text. */
  position: relative;
  z-index: 1;

@marcoscaceres

Copy link
Copy Markdown
Contributor Author

Before:
Screenshot 2026-08-18 at 5 52 49 PM

After:
Screenshot 2026-08-18 at 5 50 49 PM

@marcoscaceres
marcoscaceres requested a balanced review from Copilot August 18, 2026 07:54
@marcoscaceres
marcoscaceres marked this pull request as ready for review August 18, 2026 07:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/styles/caniuse.css.js:62

  • position: relative without a non-auto z-index does not establish a stacking context, so this explanation is incorrect. The label's own positioned z-index: 1 is sufficient for painting over the border; otherwise add z-index: 0 or isolation: isolate here if containment is intended.
  /* Establish a stacking context so the label can be lifted above the dd's
     bottom border. Reversing the visual order does not reverse paint order:
     the dd is a later sibling, so its border would paint over the label and
     strike the text through. */
  position: relative;

src/styles/caniuse.css.js:87

  • The dark-mode rendering bug described by this PR remains: the label raised above the rule still gets background-color: var(--bg, white) below, but --bg has no definition in src, so dark documents retain a white patch. Use a color-scheme-aware canvas color for the masking background.
  /* Above the dd's border, so the label's background breaks the rule instead
     of the rule striking through the text. */
  position: relative;
  z-index: 1;

@marcoscaceres
marcoscaceres force-pushed the fix/4090-caniuse-grid branch from c1b79fa to 2764896 Compare August 18, 2026 07:57
@marcoscaceres
marcoscaceres force-pushed the fix/4090-caniuse-grid branch from 2764896 to ef9b1cd Compare August 18, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Contains AI-generated logic; see AI_POLICY.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Caniuse feature improvements

2 participants