# How to style ion-icon Shadow-DOM from outside using css

**URL:** <https://forum.ionicframework.com/t/how-to-style-ion-icon-shadow-dom-from-outside-using-css/225308>\
**Category:** Ionic Vue\
**Created:** [July 23, 2022, 9:51am UTC](https://forum.ionicframework.com/t/how-to-style-ion-icon-shadow-dom-from-outside-using-css/225308 "2022-07-23T09:51:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwxgaf](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mwxgaf/32/142069_2.png) [@mwxgaf](https://forum.ionicframework.com/u/mwxgaf)\
**Post date:** [July 23, 2022, 9:51am UTC](https://forum.ionicframework.com/t/how-to-style-ion-icon-shadow-dom-from-outside-using-css/225308/1 "2022-07-23T09:51:55Z")

</div>

Hi  
I want to change the color of the `svg` inside the Shadow-DOM of `ion-icon` which is in IonActionSheet.

I’m able to do this using TypeScript like this when `ionActionSheetDidPresent` has been fired:

```javascript
document.querySelector('.deteleActionButton>span>ion-icon')?.shadowRoot?.querySelector('div>svg').?.setAttribute('style', 'color: #cf3c4f !important;');

```

`deleteActionButton` is class of the desired button (it has been set by `cssClass` option.

But the problem is → Event will be fired **after** displaying action sheet and the icon will be in its previous color for a few moments. Other events like `ionActionSheetWillPresent` doesn’t solve the problem either because there is no existing element before presenting the action sheet to work on it using TypeScript.

The only way that comes to my mind is using CSS, But there is a problem here too ☹ :  
You should style Shadow-DOM using css like this:

```css
rootElementQuery::part(part_name) {
    color: red;
}

```

And I don’t know the name of the shadow part for `ion-icon` which couldn’t be found in internet or Ionic docs.

Does anyone know the name of the Shadow-Part for `ion-icon` or any other solutions?

Thanks.

---

<div class="post-metadata">

**Author:** ![lucasbarretoo](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@lucasbarretoo](https://forum.ionicframework.com/u/lucasbarretoo)\
**Post date:** [May 2, 2023, 12:34pm UTC](https://forum.ionicframework.com/t/how-to-style-ion-icon-shadow-dom-from-outside-using-css/225308/2 "2023-05-02T12:34:10Z")

</div>

I have the same problem, you found resolution?
