Skip to content

feat: add CSS Layer support to Avatar#7950

Open
joshblack wants to merge 4 commits into
mainfrom
css-layers/00-base-test-avatar
Open

feat: add CSS Layer support to Avatar#7950
joshblack wants to merge 4 commits into
mainfrom
css-layers/00-base-test-avatar

Conversation

@joshblack

@joshblack joshblack commented Jun 9, 2026

Copy link
Copy Markdown
Member

Part of https://github.com/github/primer/issues/6275

Adds the initial CSS layer migration test setup and migrates Avatar styles into a named Primer component layer.

Changelog

New

  • Adds CSS layer coverage for migrated runtime CSS modules.
  • Adds Avatar to the CSS layer migration set.

Changed

  • Wraps Avatar CSS module styles in @layer primer.components.Avatar.

Removed

  • None

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

  • Run cd packages/react && npx vitest run src/__tests__/css-layers.test.ts --config vitest.config.mts.
  • Review this PR as part of the CSS layers stack; this entry covers Avatar.

Merge checklist

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 11a730c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

@github-actions github-actions Bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@joshblack joshblack changed the title feat: add support for CSS Layers to Avatar feat: add CSS Layer support to Avatar Jun 9, 2026
@joshblack joshblack marked this pull request as ready for review June 9, 2026 20:13
@joshblack joshblack requested a review from a team as a code owner June 9, 2026 20:13

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

Adds initial automated coverage for CSS layer migrations and migrates Avatar’s CSS Module into a named Primer component layer to improve style override behavior and ensure consistent layering as more components migrate.

Changes:

  • Added a new css-layers.test.ts and wired it into Vitest so CSS layer migrations can be validated in CI.
  • Wrapped Avatar.module.css rules in @layer primer.components.Avatar.
  • Added css-tree (+ typings) as a dev dependency to parse CSS for the new test.
Show a summary per file
File Description
packages/react/vitest.config.mts Includes the new CSS layers test in the node Vitest run.
packages/react/vitest.config.browser.mts Excludes the CSS layers test from browser-mode Vitest runs.
packages/react/src/Avatar/Avatar.module.css Wraps Avatar styles in a named @layer for cascade layer migration.
packages/react/src/__tests__/css-layers.test.ts New test to enforce presence/naming of CSS layers for allowlisted CSS Modules.
packages/react/package.json Adds css-tree and @types/css-tree for parsing CSS in tests.
package-lock.json Lockfile updates for the new dependencies.
.changeset/avatar-css-layer.md Patch changeset describing the Avatar override behavior improvement.

Copilot's findings

  • Files reviewed: 6/7 changed files
  • Comments generated: 3

Comment thread packages/react/src/__tests__/css-layers.test.ts
Comment thread packages/react/src/__tests__/css-layers.test.ts Outdated
Comment thread packages/react/src/__tests__/css-layers.test.ts
@github-actions github-actions Bot temporarily deployed to storybook-preview-7950 June 9, 2026 20:19 Inactive
@github-actions github-actions Bot temporarily deployed to storybook-preview-7950 June 9, 2026 20:27 Inactive
@github-actions github-actions Bot requested a deployment to storybook-preview-7950 June 9, 2026 20:33 Abandoned
@github-actions github-actions Bot temporarily deployed to storybook-preview-7950 June 9, 2026 20:49 Inactive
joshblack and others added 4 commits June 10, 2026 10:16
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants