Select to view content in your preferred language

How to set the hover background color on the Compass widget

793
3
10-25-2023 11:35 AM
BradBarnell
Regular Contributor

In a .css file, how do you set the hover background color for the Compass widget?

calcite-button.esri-widget--button:hover {
   --calcite-ui-???: red;
}



0 Kudos
3 Replies
JoelBennett
MVP Regular Contributor

If you're using 4.27 (and likely some prior versions), this would do it:

div.esri-compass:hover {
  background-color: #FF0000;
}

However,  due to the increased integration with Calcite and that this widget now uses a shadow DOM in 4.28, it's not possible to alter this property via a CSS selector.

0 Kudos
BradBarnell
Regular Contributor

Yep, I'm using 4.28.  I was able to change the icon hover color with css, just not the hover background.

0 Kudos
Dirk_Vandervoort
Frequent Contributor

Bumping this thread because we have encountered the same issue at 4.31

.esri-widget--button:hover {
    background-color: red!important;
}

has no impact.

0 Kudos