-
Notifications
You must be signed in to change notification settings - Fork 13
refactor(css): replacing slow selector #5576
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 3d5cb46 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR optimizes CSS selector performance by replacing the slower :is(:root, :host) pseudo-class syntax with the equivalent but faster :root, :host multi-selector syntax across the foundations package.
- Replaces
:is(:root, :host)with:root, :hostin 5 SCSS files - Maintains identical functionality and specificity
- Addresses performance bottleneck identified in CSS Selectors stats
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/foundations/scss/defaults/default-root.scss | Updated root/host selector for default styles |
| packages/foundations/scss/defaults/default-required.scss | Updated root/host selector in variables layer |
| packages/foundations/scss/defaults/_default-variables.scss | Updated root/host selector for CSS custom properties |
| packages/foundations/scss/defaults/_default-container-variables.scss | Updated root/host selector for container variables |
| packages/foundations/scss/colors/_default-color-mappings.scss | Updated root/host selector in color mappings |
| .changeset/rich-baboons-compete.md | Added changeset documenting the refactor across all affected packages |
Proposed changes
Replacing a CSS selector (
:is(:root, :host)) with a simpler one (:root, :host) that consistently appeared in the CSS Selectors stats as the lowest performer (and is the most low-hanging fruit of all).Types of changes
Further comments
🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/refactor-css-replacing-slow-selector