Select to view content in your preferred language

LayerList Component adding opacity slider on

251
1
Jump to solution
02-02-2026 02:12 PM
JamesVillanueva2
New Contributor

I am trying to embed an opacity slider in the LayerList Component inside of the listItemCreatedFunction. I get an opacity slider, but CSS formatting from themes never seem to make it to the ESRi based Slider. 

Example in CodePen  

Any suggestions is greatly appreciated.

JamesVillanueva2_0-1770070307495.png

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Sage_Wall
Esri Regular Contributor

Hi @JamesVillanueva2 ,

It's likely because of the ShadowDOM preventing from setting the styles of the widget.  I'd suggest sticking to the calcite-slider approach current sample app shows for now.  If you just want to change the look to be similar to the old dark theme you can set the "calcite-mode-dark" class on the body or on the map as this example shows.
https://codepen.io/sagewall/pen/QwErBGL


In general I'd try to avoid mixing old widgets and the new components if at all possible.

In the next 5.0 release we will have a new slider components including an opacity slider component.

View solution in original post

1 Reply
Sage_Wall
Esri Regular Contributor

Hi @JamesVillanueva2 ,

It's likely because of the ShadowDOM preventing from setting the styles of the widget.  I'd suggest sticking to the calcite-slider approach current sample app shows for now.  If you just want to change the look to be similar to the old dark theme you can set the "calcite-mode-dark" class on the body or on the map as this example shows.
https://codepen.io/sagewall/pen/QwErBGL


In general I'd try to avoid mixing old widgets and the new components if at all possible.

In the next 5.0 release we will have a new slider components including an opacity slider component.