fix(steps): anchor the empty-step-content :has to the step item - #255
Merged
Conversation
lucaspunz
force-pushed
the
lucas/step-anchored-has
branch
from
August 20, 2026 00:38
9ddfefe to
10861f3
Compare
lucaspunz
force-pushed
the
lucas/step-anchored-has
branch
from
August 20, 2026 00:41
10861f3 to
e0fbe31
Compare
lucaspunz
force-pushed
the
lucas/step-anchored-has
branch
from
August 20, 2026 00:52
897605a to
9a555ed
Compare
lucaspunz
marked this pull request as ready for review
August 20, 2026 01:11
Merged
dks333
reviewed
Aug 20, 2026
dks333
approved these changes
Aug 20, 2026
Co-authored-by: Kaishan (Sam) Ding <52273168+dks333@users.noreply.github.com>
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.
Summary
Removes both sources of universal-subject
:has()selectors, which force whole-document style recalc on every DOM mutation in consumers:group-has-[...]/step:hiddenre-anchored to the step item:[[role=listitem]:has(…)_&]:hidden.:has(…) > [data-component-part=code-block-root]padding rules could only ever match the CodeBlock root div, which already knows at render time whether it has a header or floating buttons — the root now stampsdata-has-header/data-has-floating-buttonsand the rules anchor to those. CodeGroup never matched either rule.Biome GritQL plugins ban both shapes from returning:
group-has-in JS/TSX strings, bare:has(selectors in css (anchored:hasstays allowed).Consumer impact: perf-only; the DOM gains one inert
data-has-*attribute on the CodeBlock root (snapshot-test churn at bump time).Test Plan
pnpm build: nogroup-hasor universal-subject:has(anywhere in distpnpm lint:checkgreen; both plugins fire on synthetic violations, silent on anchored:hasNote
Low Risk
Performance-oriented selector and attribute changes with no intended behavior change; only an extra inert
data-has-*on CodeBlock roots for consumers.Overview
Eliminates universal-subject
:has()patterns that trigger expensive whole-document style recalc on DOM mutations in consuming apps.Steps: The last-step connector hide rule drops
group-has-…/stepin favor of an ancestor-anchored variant:[[data-component-part=step-item]:has([data-component-part=step-content]:empty)_&]:hidden(same UX: line hidden when step content is empty).Code blocks:
code.cssno longer uses bare:has(…)for padding; the CodeBlock root now setsdata-has-headerordata-has-floating-buttonsat render time, and CSS targets those attributes instead.Lint: Two Biome Grit plugins block regressions—
group-has-in class strings and universal-subject:has(in CSS (anchored:hasremains allowed).Reviewed by Cursor Bugbot for commit 5d81bb0. Bugbot is set up for automated code reviews on this repo. Configure here.