# Editing CSS shadow part of an ionic select text (color) without affecting other instance of ion select

**URL:** <https://forum.ionicframework.com/t/editing-css-shadow-part-of-an-ionic-select-text-color-without-affecting-other-instance-of-ion-select/220420>\
**Category:** Ionic React\
**Created:** [February 12, 2022, 7:53pm UTC](https://forum.ionicframework.com/t/editing-css-shadow-part-of-an-ionic-select-text-color-without-affecting-other-instance-of-ion-select/220420 "2022-02-12T19:53:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![javier-soto-dev15](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/javier-soto-dev15/32/140804_2.png) [@javier-soto-dev15](https://forum.ionicframework.com/u/javier-soto-dev15)\
**Post date:** [February 12, 2022, 7:53pm UTC](https://forum.ionicframework.com/t/editing-css-shadow-part-of-an-ionic-select-text-color-without-affecting-other-instance-of-ion-select/220420/1 "2022-02-12T19:53:21Z")

</div>

I am trying to edit the color of inside text of an ion select when i pick an option, but once i edit the shadow part in the component, the rest of the ion selects (in other components) are taking this change. I just want to encapsulate this color change, but i can not without editing the shadow part and affecting the rest as they have different colors.  
I have tried to put them in different css files but i doesnt work of course.  
Example, i have an ion select in a component with this css

```
ion-select::part(text){
    font-weight: 900;
    color: white;
}

```

but it gets overwritten with the css of another component that i edit

```
ion-select::part(text){
    font-weight: 900;
    color: #c00000;
}

```

Any help with CSS shadow parts it’s appreciate it

---

<div class="post-metadata">

**Author:** ![Tommertom](https://avatars.discourse-cdn.com/v4/letter/t/ed8c4c/32.png) [@Tommertom](https://forum.ionicframework.com/u/Tommertom)\
**Post date:** [February 12, 2022, 8:32pm UTC](https://forum.ionicframework.com/t/editing-css-shadow-part-of-an-ionic-select-text-color-without-affecting-other-instance-of-ion-select/220420/2 "2022-02-12T20:32:20Z")

</div>

maybe assign a class to the selector you like to change, and use the class selector in css to target the shadow part of that selected class?

---

<div class="post-metadata">

**Author:** ![javier-soto-dev15](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/javier-soto-dev15/32/140804_2.png) [@javier-soto-dev15](https://forum.ionicframework.com/u/javier-soto-dev15)\
**Post date:** [February 12, 2022, 8:59pm UTC](https://forum.ionicframework.com/t/editing-css-shadow-part-of-an-ionic-select-text-color-without-affecting-other-instance-of-ion-select/220420/3 "2022-02-12T20:59:16Z")

</div>

I tried this but the shadow dom doesnt pick it up

```auto

.selector-red ion-select::part(text){
    font-weight: 900;
    color: #c00000;
}

```

---

<div class="post-metadata">

**Author:** ![javier-soto-dev15](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/javier-soto-dev15/32/140804_2.png) [@javier-soto-dev15](https://forum.ionicframework.com/u/javier-soto-dev15)\
**Post date:** [February 12, 2022, 9:03pm UTC](https://forum.ionicframework.com/t/editing-css-shadow-part-of-an-ionic-select-text-color-without-affecting-other-instance-of-ion-select/220420/4 "2022-02-12T21:03:28Z")

</div>

I found the right way to do it, with a class selector (i didnt know this) selector-red in this case would be the class name

```auto
ion-select.selector-red::part(text){
    font-weight: 900;
    color: #c00000;
}

```
