Select to view content in your preferred language

Legend Widget symbol opacity override

231
3
Jump to solution
02-27-2024 12:04 PM
AnthonyThompsonFWP
New Contributor II

Is there a way to override the opacity of a symbol displayed in the Legend widget without altering the layer's opacity? A partially transparent layer's symbol is darkened significantly by a dark widget background when displayed as a symbol in the Legend with our branded dark background.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
MatthewDriscoll
MVP Alum

Here is a working codepen example.  I have the timeout set really high so you will need to wait around 15-30 seconds to see the opacity change on the 4th item in the legend.

https://codepen.io/mbdriscoll/pen/XWQWexm

 

View solution in original post

3 Replies
MatthewDriscoll
MVP Alum

You need to change the opacity of the class esri-legend__symbol. 

0 Kudos
MatthewDriscoll
MVP Alum

Here is a working codepen example.  I have the timeout set really high so you will need to wait around 15-30 seconds to see the opacity change on the 4th item in the legend.

https://codepen.io/mbdriscoll/pen/XWQWexm

 

AnthonyThompsonFWP
New Contributor II

Thank you for the suggestion and example!

0 Kudos