Menu Style override problem in v3.13.8 #282

Closed
opened 2026-01-29 17:34:42 +00:00 by claunia · 1 comment
Owner

Originally created by @Webreaper on GitHub (Dec 21, 2021).

Hi, I'm using Radzen for the context menu control, and have over-ridden the styles to give a compact menu (see screenshot attached). This has worked fine for around 12 months.

Screenshot 2021-12-21 at 00 19 42

I upgraded to the most recent version (3.13.8) and now my style:

.rz-navigation-item-link {
    padding: 1px 1px;
}

Isn't taking effect; for some reason the Radzen default.css style has higher priority. Have you changed something recently, perhaps to enable CSS isolation or something like that? The end result ends up looking more like this:

Screenshot 2021-12-21 at 00 23 07

I was able to fix it by reverting to v3.11.12. Any ideas what's changed, and how to fix it properly?

Originally created by @Webreaper on GitHub (Dec 21, 2021). Hi, I'm using Radzen for the context menu control, and have over-ridden the styles to give a compact menu (see screenshot attached). This has worked fine for around 12 months. <img width="398" alt="Screenshot 2021-12-21 at 00 19 42" src="https://user-images.githubusercontent.com/4901102/146849936-ec51c854-4691-438c-ac6f-e53585287899.png"> I upgraded to the most recent version (3.13.8) and now my style: ``` .rz-navigation-item-link { padding: 1px 1px; } ``` Isn't taking effect; for some reason the Radzen default.css style has higher priority. Have you changed something recently, perhaps to enable CSS isolation or something like that? The end result ends up looking more like this: <img width="346" alt="Screenshot 2021-12-21 at 00 23 07" src="https://user-images.githubusercontent.com/4901102/146850191-3f78df8a-971d-4df4-9a28-12ed8f77fb44.png"> I was able to fix it by reverting to v3.11.12. Any ideas what's changed, and how to fix it properly?
Author
Owner

@akorchev commented on GitHub (Dec 21, 2021):

You can use your browser's developer tools to inspect the current CSS that applies to the item. You probably need to increase the specificity of your selector or use !important. The default theme specifies the padding like this:

rz-menu:not(.rz-profile-menu) .rz-navigation-item-wrapper .rz-navigation-item-link {
   padding: 0.8125rem 0.625rem;
}
@akorchev commented on GitHub (Dec 21, 2021): You can use your browser's developer tools to inspect the current CSS that applies to the item. You probably need to increase the specificity of your selector or use `!important`. The default theme specifies the padding like this: ``` rz-menu:not(.rz-profile-menu) .rz-navigation-item-wrapper .rz-navigation-item-link { padding: 0.8125rem 0.625rem; } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#282