WAIT: Using variables in 1.8 beta2 colour palette breaks functionality

Browser: Chrome 113.0.5672.126 (Official Build) (64-bit)
OS: Linux Mint 21.1
URL: it’s on my PC (localhost)

Videos:
Part 1: Variables in Bricks 1.8 beta2 colour palette: Broken or just Confusing? Part 1 - YouTube
Part deux: Variables in Bricks 1.8 beta2 colour palette: Broken or just Confusing? Part 2 - YouTube

Steps to Reproduce:

  1. Write a CSS variable for a colour
  2. Save as hex colour in Bricks colour palette
  3. Edit that colour
  4. Remove hex code and use variable from step 1 instead
  5. Save

Behaviour is confusing and unpredictable when attempting to save variables as colour palette presets. At first, I had issues saving the variable, as nothing would happen when I pressed Enter or clicked the Save icon.

Later (when I recorded the videos), it started working. I now have two colours in my palette that appear as active (green dot) and cannot be selected (nothing happens when clicking them).

It’s a bit hard to describe. The videos show the issue as clearly as I can describe it. This very much looks like a bug to me, but I might just be misunderstanding the logic here.

Important follow-up: After replacing my magenta colour preset with my variable, the preset definitely no longer works.

I changed the variable so the colour is now brown, not magenta. Still, everything on my website is still magenta. I would need to manually update every class and element on my entire website now, because the colour preset is definitely broken.

Hey @mr.matt.eastwood,

thanks for your report.

It’s hard to follow the videos and find out what the actual problem is to be honest. It would be great if you could provide us with some exact steps to reproduce a possible problem.

I just set up a fresh (beta 2) demo site, created some custom colors in a WPCB SCSS snippet, added those colors to a custom palette in Bricks and was able to work with those colors without issues.

Best,

André

Hey André, thanks for following up so quickly. I’ll uload a fresh build of my test site and get back to you with detailed steps.

same here - i was doing a video about color variables and the issue came up : Loom | Free Screen & Video Recording Software | Loom

Hey Matt,

that’d be great, thanks. Here you can see a quick demonstrating of my fresh setup: Video uploaded to CleanShot Cloud.

Best,

André

1 Like

Hey Isaac,

you’re importing lots of colors with CSS vars. Like var(--color-a), var(--color-b) and so on. And Bricks correctly imports those as shown in your video. But you do not add the CSS somewhere which translates those variables into actual colors (or at least you do not show it in the video).

See Video uploaded to CleanShot Cloud.

Best,

André

i see, will check and update thanks!

Yeah, your video suggests this has something to do with my build. It’s here now:

https://brxtest.brandartery.de/

I made you an admin account and am sending you a PM with the access data. New video:

Steps to Reproduce:

  1. Open front page in Bricks
  2. Pick e.g. a text element, go to Style > Typography
  3. Edit any of the 4 preset colours
  4. Remove its hex value
  5. Put variable var(–fill) in
  6. Save

Step 6 might not work on the first attempt. After that, the newly updated colour preset becomes un-selectable and none of the elements and classes on the website that use this colour are updated.

i still have an issue: the colors register only partly

Hey Isaac,

that makes sense cause your “main colors” don’t have the correct format. This is what gets output on the frontend:

As you can see the first five color vars don’t have valid CSS color values in them. So what you’re trying to do results in an invalid CSS statement like color: 229, 105, 96;.

Best,

André

1 Like