# Not able to set a style conditional based on the value of a field

**URL:** <https://forum.bubble.io/t/not-able-to-set-a-style-conditional-based-on-the-value-of-a-field/373902>\
**Category:** Mobile Beta - bugs\
**Created:** [June 25, 2025, 1:15pm UTC](https://forum.bubble.io/t/not-able-to-set-a-style-conditional-based-on-the-value-of-a-field/373902 "2025-06-25T13:15:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![finitejest](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/finitejest/32/248088_2.png) [@finitejest](https://forum.bubble.io/u/finitejest)\
**Post date:** [June 25, 2025, 1:15pm UTC](https://forum.bubble.io/t/not-able-to-set-a-style-conditional-based-on-the-value-of-a-field/373902/1 "2025-06-25T13:15:34Z")

</div>

I’m trying to use a conditional on a style to set a background color that’s different if the user has dark mode specified in their settings. I’m getting this error:

 ![Screenshot 2025-06-25 at 8.13.32 AM](https://us1.discourse-cdn.com/bubble/original/3X/6/a/6a8a79b3c10e26260b4eb5e032020799c3d9a8d5.png)

I would consider this a bug. Is there a work around that anyone is using?

---

<div class="post-metadata">

**Author:** ![jomo25](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jomo25](https://forum.bubble.io/u/jomo25)\
**Post date:** [June 25, 2025, 1:22pm UTC](https://forum.bubble.io/t/not-able-to-set-a-style-conditional-based-on-the-value-of-a-field/373902/2 "2025-06-25T13:22:21Z")

</div>

UPDATE: Ugh nvm. I realize i may have misunderstood your question/issue. If so, im sorry.  
——  
I dont know if it’s a bug. I think it’s same behavior as in web builder (since they share the same backend). I know the way i saw it implemented was by setting a state on the user’s profile if i recall correctly. It was in a video i saw. I’ll link the video once i find it.

Here’s the video:

[![](https://img.youtube.com/vi/kDRLpThj4Co/maxresdefault.jpg "Create Light & Dark Mode on Bubble in Under 2 Minutes! | Bubble.io Tutorials") ](https://www.youtube.com/watch?v=kDRLpThj4Co)

I had a similar need, but unfortunately, that work around wasnt convenient for me. So i did change at the global style level, i changed on the element level in my page. Not ideal i know, and more configuring, but it worked for me.

---

<div class="post-metadata">

**Author:** ![finitejest](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/finitejest/32/248088_2.png) [@finitejest](https://forum.bubble.io/u/finitejest)\
**Post date:** [June 25, 2025, 1:44pm UTC](https://forum.bubble.io/t/not-able-to-set-a-style-conditional-based-on-the-value-of-a-field/373902/3 "2025-06-25T13:44:45Z")

</div>

Yeah - that video has a conditional on the appearance for body that says "Current User’s Dark Mode is “yes” … which is exactly what I’m doing basically… and what spawns that error. Weird looking error too. Feels like something is unfinished there.

---

<div class="post-metadata">

**Author:** ![finitejest](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/finitejest/32/248088_2.png) [@finitejest](https://forum.bubble.io/u/finitejest)\
**Post date:** [June 25, 2025, 1:47pm UTC](https://forum.bubble.io/t/not-able-to-set-a-style-conditional-based-on-the-value-of-a-field/373902/4 "2025-06-25T13:47:19Z")

</div>

Ah - but you CAN do a conditional based on a field that’s set to yes / no. You cannot do a conditional on a field that is tied to an option set or is data.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [July 9, 2025, 1:16pm UTC](https://forum.bubble.io/t/not-able-to-set-a-style-conditional-based-on-the-value-of-a-field/373902/5 "2025-07-09T13:16:22Z")

</div>

This topic was automatically closed after 14 days. New replies are no longer allowed.
