-
Notifications
You must be signed in to change notification settings - Fork 425
feat(ui): Add warning for structural CSS customization without version pinning #7590
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: bb6f356 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…n pinning Add a development-mode console warning when users customize Clerk components using structural CSS patterns that may rely on internal DOM structure: - Detects appearance.elements with combinators (>, +, ~), positional pseudo-selectors (:nth-child, etc.), :has(), or multiple .cl- classes - Detects external CSS stylesheets targeting .cl- classes structurally - Only runs in development mode, deferred via setTimeout to avoid blocking - Uses hasChecked guard to prevent rescanning on component remount The warning guides users to pin their @clerk/ui version to avoid breakages when internal DOM structure changes between versions. Co-Authored-By: Claude Opus 4.5 <[email protected]>
6a73890 to
bb6f356
Compare
|
!snapshot |
|
Hey @brkalow - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact
npm i @clerk/[email protected] --save-exact |
Summary
appearance.elements(CSS-in-JS) and external stylesheets targeting.cl-classes@clerk/uiversion to avoid breakagesDetection Criteria
Structural patterns that trigger the warning:
>,+,~) with.cl-classes.cl-classes:nth-child,:first-child, etc.):has()selector.cl-classes in a single selector.cl-class (e.g.,div.cl-button)Safe patterns that do NOT trigger the warning:
.cl-class styling (e.g.,.cl-button { color: red }):hover,:focus::before,::afterappearance.elementsPerformance Considerations
setTimeoutto avoid blocking component mounthasCheckedguard to prevent rescanning on remountappearance.elements(skips stylesheet scan)Test plan
detectStructuralClerkCss()- 16 testswarnAboutCustomizationWithoutPinning()- 18 tests🤖 Generated with Claude Code