RE: Use var() in builder color fields

Just a follow up to my previous post, it would open up a world of possibilities if we could use var() variables in the builder color fields. I’m wanting to make a dark mode variant for my site, but it starts getting real complicated if I can’t do this. I know there’s a hacky workaround using the browser inspector, but it’s not exactly user-friendly. Just wanted to put my oar in again to see if its on the list.

1 Like

Maybe somehow it could be possible with the upcoming Theme Option Reboot cycle where we’ll be able to create multiple color palettes. You’d then need to be able to have a button or toggle switch on the front end that could switch color palettes, so the site visitor can decide to turn on dark mode. I’ve asked about this before and I think the conclusion was that it’s not possible to do this with what they have planned, but maybe they can re-consider it and somehow make it work if there’s enough demand.

Hi @bobbybosler,

For 6.0 we’re working on a Globals/Variables system that will replace the color and font managers. You’ll be able to arbitrarily define “variables” which could be colors, fonts, dimensions, icons, text, etc. and mange those site wide. Then they will appear in the color pickers. CSS var() will be used in the generated CSS to manage this, so in theory you could overwrite that on the front end again with some custom CSS. Looking forward to your thoughts once we get closer to that being ready.

@JvP, as part of this system we are exploring the idea of palette that you can define to quickly overwrite batches of global variables. I can’t say for sure if it will be in the final implementation though. We’re talking about allowing palettes to be defined on a set of arbitrary variables which is going to be challenging to get just right from a mechanics and UX perspective.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.