# Ionic change causes css to stop working - any way to modify shadow dom to fix it?

**URL:** <https://forum.ionicframework.com/t/ionic-change-causes-css-to-stop-working-any-way-to-modify-shadow-dom-to-fix-it/238400>\
**Category:** Ionic Framework\
**Created:** [December 12, 2023, 10:48pm UTC](https://forum.ionicframework.com/t/ionic-change-causes-css-to-stop-working-any-way-to-modify-shadow-dom-to-fix-it/238400 "2023-12-12T22:48:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [February 1, 2024, 5:08pm UTC](https://forum.ionicframework.com/t/ionic-change-causes-css-to-stop-working-any-way-to-modify-shadow-dom-to-fix-it/238400/4 "2024-02-01T17:08:45Z")

</div>

I was just looking at some of my saved code snippets and came across this snippet on how to access the Shadow DOM via JS. In this example we are editing an `IonModal`. I don’t recall if it worked or not as I am not currently using it (maybe found a better solution for what I was trying to do).

```js
this.modal.shadowRoot
    ?.querySelector('slot')
    ?.assignedElements()
    .find(element => element.classList.contains('ion-page'))
    ?.classList.remove('ion-page')

```

---

_[View the full topic](https://forum.ionicframework.com/t/ionic-change-causes-css-to-stop-working-any-way-to-modify-shadow-dom-to-fix-it/238400)._
