fix(registry): remove cn-menu-target from installable components#9696
Open
eduardbar wants to merge 1 commit intoshadcn-ui:mainfrom
Open
fix(registry): remove cn-menu-target from installable components#9696eduardbar wants to merge 1 commit intoshadcn-ui:mainfrom
eduardbar wants to merge 1 commit intoshadcn-ui:mainfrom
Conversation
The cn-menu-target class is a shadcn.com website-internal implementation detail used by design-system-provider.tsx to dynamically inject a dark class for inverted menu color theming. It has no effect in user projects and causes unexpected behavior when the dark class is added to installed components at runtime. Fixes shadcn-ui#9658
Contributor
|
Someone is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #9658.
The
cn-menu-targetclass is a shadcn.com website-internal implementation detail — it exists only to allowdesign-system-provider.tsxto dynamically add/remove adarkclass via JavaScript when the user selects the "inverted" menu color theme on the website.This class has no meaning in user projects, but it was included in the installable registry components (
dropdown-menu,context-menu,menubar,select,combobox) for bothbase-uiandradixvariants, as well as their RTL counterparts and preview examples.The effect in user code: any installed component with
cn-menu-targetbecomes a target for externaldarkclass injection if anyone happens to use the same class name — a silent, invisible side effect.Changes
Removed
cn-menu-targetfrom all user-installable registry and example components (30 files total). The class is intentionally preserved in:apps/v4/app/(create)/components/design-system-provider.tsx— where it is usedapps/v4/app/(create)/components/picker.tsx— website internalAffected components
dropdown-menu,context-menu,menubar,select,comboboxacross:registry/bases/base/ui/(base-ui variants)registry/bases/radix/ui/(radix variants)examples/base/ui/andexamples/base/ui-rtl/examples/radix/ui/andexamples/radix/ui-rtl/