perf(Banner): replace :has(.BannerActions) with data-has-actions attribute#7598
Open
hectahertz wants to merge 2 commits intomainfrom
Open
perf(Banner): replace :has(.BannerActions) with data-has-actions attribute#7598hectahertz wants to merge 2 commits intomainfrom
hectahertz wants to merge 2 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 20e461a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
This was referenced Feb 26, 2026
jonrohan
approved these changes
Feb 27, 2026
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.
Closes #
Replaces 4 CSS
:has(.BannerActions)selectors in Banner with[data-has-actions]attribute selectors.Banner.tsxalready computeshasActions = primaryAction || secondaryActionin render but wasn't exposing it as a data attribute. This PR addsdata-has-actionsto the<section>root and swaps out the:has()selectors for attribute checks.Same pattern as #7556 (ActionList) and #7597 (Button).
Selectors replaced:
.Banner[data-title-hidden]:not(:has(.BannerActions))(2 instances, content/icon sizing):where(.Banner):has(.BannerActions)(dismiss margin).BannerContainer:has(.BannerActionsContainer)(container query grid rows)Changelog
New
N/A
Changed
[data-has-actions]attribute selectors instead of:has(.BannerActions)for action detectionRemoved
N/A
Rollout strategy
Testing & Reviewing
One new
data-has-actionsattribute on the Banner root, rest is CSS selector replacement. Specificity is preserved.main@container banner (max-width: 500px)breakpoint with actions presentMerge checklist