How can I style TelerikContextMenu for border type, background color and hover color?

1 Answer 17 Views
ContextMenu
Marcin
Top achievements
Rank 1
Iron
Iron
Marcin asked on 24 May 2024, 02:33 PM

These three questions may seem simple, but for some reason I have not been able to find how to style the context menu nor have I been able to achieve this through css:

1. How can I remove the "border" around the top-most context menu item (in attached pic1, the 'Filter by value' item)

2. How can I change the "reddish" hover color to a color of my choosing? (in attached pic1, the background of 'Open faceplate' item)

3. How can I change the "red" background selection color to a color of my choosing? (in attached pic2, the background of 'Open faceplate' item)

Much thanks

Marcin
Top achievements
Rank 1
Iron
Iron
commented on 27 May 2024, 06:32 PM

I managed to change the hover color of a list item as follows:

<style>
    /* context menu selected hover color */
    ul.k-menu.k-context-menu .k-item > .k-link:hover,
    ul.k-menu.k-context-menu .k-item > .k-link.k-hover {
        background-color: var(--ctxt-item-selected);
    }
...
</style>
but I still haven't managed to find the difinition for the border around the first context menu item. Any help is appreciated

1 Answer, 1 is accepted

Sort by
0
Accepted
Marcin
Top achievements
Rank 1
Iron
Iron
answered on 28 May 2024, 07:15 PM

So I stumbled across the following solution and thought I'd post it for anyone else who encounters this:

1) To get rid of the border around the context menu item:


 ul.k-menu.k-context-menu .k-menu-item:focus > .k-link {
        box-shadow: none !important;
    }
For answers to questions 2 & 3, please see the comments.
Tags
ContextMenu
Asked by
Marcin
Top achievements
Rank 1
Iron
Iron
Answers by
Marcin
Top achievements
Rank 1
Iron
Iron
Share this question
or