Skip to content
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

chore: Ensure class names conform to PascalCase #5716

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

hussam-i-am
Copy link
Contributor

Closes https://github.com/github/primer/issues/4250

Changelog

New

Changed

  • Adds selector-class-pattern rule to check casing of class names
  • Updates classes that did not conform to casing
  • Wraps focus-visible and :popover-open classes with :global and make them exceptions to the rule

Removed

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

Merge checklist

@hussam-i-am hussam-i-am self-assigned this Feb 20, 2025
@hussam-i-am hussam-i-am requested a review from a team as a code owner February 20, 2025 16:15
Copy link

changeset-bot bot commented Feb 20, 2025

🦋 Changeset detected

Latest commit: 6ae6fbe

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 Minor

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

Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Feb 20, 2025
& > .ItemLabel {
font-weight: var(--base-text-weight-semibold);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@langermank I did not see any usage of this class anywhere, so I removed it. Can you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh weird, it is used in Item

AL item

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I meant ActionListContent--hasActiveSubItem. I didn't see an explicit reference to it, or a concatenation of hasActiveSubItem

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah! Yes, that doesn't appear to be used.

[tabindex='0']:focus:not(:focus-visible):not(.focus-visible),
details-dialog:focus:not(:focus-visible):not(.focus-visible) {
[tabindex='0']:focus:not(:focus-visible):not(:global(.focus-visible)),
details-dialog:focus:not(:focus-visible):not(:global(.focus-visible)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonrohan I noticed that these did not have the :global wrapper, which I assume are needed for it to behave as expected.

Copy link
Contributor

github-actions bot commented Feb 20, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 105.72 KB (-0.05% 🔽)
packages/react/dist/browser.umd.js 105.97 KB (-0.19% 🔽)

&.\\:popover-open,
&.\\:popover-open::before {
/* stylelint-disable-next-line selector-class-pattern */
&.\\:popover-open, &:global(.\\:popover-open)::before {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-actions github-actions bot requested a deployment to storybook-preview-5716 February 20, 2025 16:26 Abandoned
Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to put this together! Just left one comment but otherwise 100% down to give this a try 👍

})}
/>
) : null}
{direction === SortDirection.DESC ? (
<SortDescIcon
className={clsx('TableSortIcon', 'TableSortIcon--descending', {
[classes.TableSortIcon]: enabled,
[classes['TableSortIcon--descending']]: enabled,
Copy link
Member

Choose a reason for hiding this comment

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

For this style I think it'd be helpful to preserve the original convention from BEM until we can update it to use our preferred approach with data attributes. Having -descending ends up as a weird hybrid between the two and I think it can lose the modifier meaning because of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, updated

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants