-
Notifications
You must be signed in to change notification settings - Fork 599
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
Conversation
🦋 Changeset detectedLatest commit: fc925ea 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 |
👋 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! |
& > .ItemLabel { | ||
font-weight: var(--base-text-weight-semibold); | ||
} | ||
} |
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.
@langermank I did not see any usage of this class anywhere, so I removed it. Can you confirm?
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.
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.
Sorry, I meant ActionListContent--hasActiveSubItem
. I didn't see an explicit reference to it, or a concatenation of hasActiveSubItem
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.
Ah! Yes, that doesn't appear to be used.
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.
Would be cool to setup something that would check for unused CSS
[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)) { |
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.
@jonrohan I noticed that these did not have the :global
wrapper, which I assume are needed for it to behave as expected.
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.
🤷🏻 I guess so, but this change might need to be verified
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.
This is going in on the next release, anything specific that needs to be validated UI-wise before landing this? @jonrohan @hussam-i-am
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.
Not sure how to recreate this selector in the dom. Maybe drop a focus-visible class on a details-dialog element
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.
Double checked, doesn't look like it breaks anything. We have some duplicate styles for this in primer/css that's already being imported
size-limit report 📦
|
&.\\:popover-open, | ||
&.\\:popover-open::before { | ||
/* stylelint-disable-next-line selector-class-pattern */ | ||
&.\\:popover-open, &:global(.\\:popover-open)::before { |
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.
@jonrohan similar to https://github.com/primer/react/pull/5716/files#r1963911493, wrapped these in :global
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.
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, |
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.
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.
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.
Makes sense, updated
…am/stylelint-pascal
& > .ItemLabel { | ||
font-weight: var(--base-text-weight-semibold); | ||
} | ||
} |
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.
Would be cool to setup something that would check for unused CSS
[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)) { |
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.
🤷🏻 I guess so, but this change might need to be verified
Yeah, I thought we already had something that checks, but I guess not in primer |
…mer/react into hussam-i-am/stylelint-pascal
@jonrohan I added the package typed-css-modules, which will generate type definition files and at least ensure we are using class names that do exist. Couldn't find a clear solution for ensuring that any classes within the css file are being used. |
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.
Nice actually found some typos and incorrectly capitalized classes
Closes https://github.com/github/primer/issues/4250
Changelog
New
Changed
selector-class-pattern
rule to check casing of class namesfocus-visible
and:popover-open
classes with:global
and make them exceptions to the ruleRemoved
Rollout strategy
Testing & Reviewing
Merge checklist