Dynamic Background feedback for switching between Canvas pages

So I’m able to switch between canvas pages with buttons, but was wondering if there is a current way to use whichever page you’re on as info for a dynamic background colour.
For instance, when I’m on my first canvas page I would create a dynamic background for my button and make it lighter when I’m on that page, same for each page.

Thanks heaps :smiley:

Great request @Adam_Molinaro . That would be very helpful

I haven’t thoroughly tested this yet, but you should be able to get the behavior you described like this:

${location.pathname.startsWith("/canvas/canvas-1") ? "green-400" : "green-800"}

This path is just the URL you see when you open your canvas. You can replace it with any path corresponding to your canvases.

Let me know if this works for you! :slight_smile:

EDIT: I’m planning on adding an option that lets buttons behave like links and could imagine offering an option to set a different background color that is used when the link of the button is currently active.

1 Like

Yep that works, thank you so much!! :smiley: