Skip to main content
lucasvieluz
June 21, 2023
Question

Help to set an image value in variables?

  • June 21, 2023
  • 13 replies
  • 12696 views

I need set value for assets in my design system, ex:
My logo dark mode vs light mode, the brand asset are different for the color scheme.

The options available are:

  • Color
  • Number
  • String
  • Boolean

I try insert the URL from image value in string, but I dont have success to retrieve value and set for background.

Anyone have a idea to resolve this? 🤯

Anynone can help me?

This topic has been closed for replies.

13 replies

Henk
New Member
March 25, 2025

This would be such a great feature. I was looking for it today and I can’t believe it’s not there.

morebutworse
New Member
May 28, 2025

I found myself needing this today as well.

Use case: Light vs Dark modes. I have a help page, where I have a screenshot of another page, that is being used as an example. It looks very out of place in dark mode to see the light mode version of the page.

Oops, I got all the way to the bottom and Henk’s comment made me think I was on a feature request. Sorry for the unhelpful update.

Gary Byrne
New Member
June 3, 2025

​@morebutworse I got this to work. I tried what ​@Mattias_Berkesten1 suggested. This is what I did: 

  1. I took my two images (light and dark versions) and place them in a frame with dark mode image at the top.
  2. I then created a component 
  3. In my colour modes variable collection, I created a boolean variable called “dark-mode”
    1. In the light mode column, I set the boolean property to “false”
    2. In the dark mode column, I set the boolean property to “true”
  4. Back in the component, I selected the dark mode image (actual image layer, not the whole component) and applied the “dark-mode” variable I’d just created. In the Appearance section by clicking the “Apply variable/property icon.
  5. Now, by default in light mode or auto, the dark mode image is hidden. When I switch to dark mode, the layer property/variable changes from false to true and reveals the dark mode image.

I hope that helps