Skip to content

docs: add css layer names adr #6030

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

joshblack
Copy link
Member

@joshblack joshblack commented May 9, 2025

View Rendered ADR

Adds an ADR in order to define our CSS Layers and the order that they should be applied in. I wanted to take a stab at defining this for us as we start moving more into CSS Layers world. Defining the layers and their order should help address issues like: https://github.com/github/primer/issues/5181 since we will have a deterministic order in which styles are applied.

This was a quick draft so let me know if you have any questions or feedback! In particular, would love to see any resources you all might have that talk about this in other systems 👀 I linked a couple but I'm sure there are more out there.

@Copilot Copilot AI review requested due to automatic review settings May 9, 2025 15:31
@joshblack joshblack requested a review from a team as a code owner May 9, 2025 15:31
@joshblack joshblack requested a review from francinelucca May 9, 2025 15:31
Copy link

changeset-bot bot commented May 9, 2025

⚠️ No Changeset found

Latest commit: 5cb4d27

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the staff Author is a staff member label May 9, 2025
@joshblack joshblack added the skip changeset This change does not need a changelog label May 9, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 introduces an ADR to define the named CSS layers and their application order within Primer.

  • Specifies five core layers (base, theme, icons, components, utilities) and their ordering
  • Establishes naming conventions (camelCase for layers, PascalCase for component layers) and namespace usage
  • Details the impact on Primer libraries and poses an unresolved question about where ordering should be defined
Comments suppressed due to low confidence (1)

contributor-docs/adrs/adr-022-css-layer-names.md:8

  • [nitpick] The status table shows 'Approved' with 🚧 and comments out 'Adopted'. Update the table to reflect the current stage or uncomment the Adopted status when appropriate, and use consistent labels to avoid confusion.
| Adopted  | <!-- ✅ --> |

Comment on lines +21 to +23
- Resets
- Utilities
- Product
Copy link
Preview

Copilot AI May 9, 2025

Choose a reason for hiding this comment

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

The Context section lists 'Resets' and 'Product' as potential layers, but they are not defined in the Decision. Consider removing them or clarifying how they map into existing layers (e.g., base or theme).

Suggested change
- Resets
- Utilities
- Product
- Resets (mapped to the `base` layer in the Decision section)
- Utilities
- Product (not currently part of the defined layers but may be considered in the future)

Copilot uses AI. Check for mistakes.

Copy link
Contributor

github-actions bot commented May 9, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 98.53 KB (0%)
packages/react/dist/browser.umd.js 98.84 KB (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changeset This change does not need a changelog staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant