NO BUG: Variables manager doesn't replace renamed variable instances

Browser: Chrome 126.0.6478.127
OS: Win 11
Bricks: 1.9.9

Hi :slight_smile: I want to report two possible bugs in the variable manager in Bricks 1.9.9:

  1. If you change the name of an already created variable, Bricks wouldn’t change the name for all the instances already put in place. In my case I have a variable called “radius” and I’ve changed it to “radius5”. Anywhere var(–radius) has been used, it stays like this and breaks the design. Bricks doesn’t do search & replace, if you will. Is this the expected behavior?

Steps to reproduce issue:

  • Create a variable
  • Use the variable somewhere
  • Go to the variables manager and rename this variable
  • See how design breaks.
  1. I have set variables for colors, so having “gray-900”, “gray-800”, “gray-200”, etc. In the RAW fields for colors, if I start typing gray, then I see all the gray variables, but if I type 200, 900, nothing pops up. Is this the expected behavior? Shouldn’t the match be loose?

Steps to reproduce issue:

  • Set a variable like “gray-900”.
  • Try to insert the variable in the RAW color typing the number, instead of the letters.
  • Doesn’t work on my side :smiley:

Also, now that we have the variables manager, shouldn’t it be convenient to set a variable when typing its name right into the HEX section of the colors? This would save a few clicks here and there :slight_smile:

Thanks very much!

[Please describe this bug in as much detail as possible so we can replicate & debug this bug]

Hi Valentin,
Thanks so much for your report!

Yes, this is the expected behavior. There’s currently no code that would do the job. See: Global Variables Manager – Bricks Academy

  • Bulk actions: …such as renaming and duplicating. … However, it’s important to note that renaming a CSS variable does not automatically update its instances throughout your site.

 

This is a similar limitation to this one:
WIP: CSS variable picker (dropdown) we cannot search for dash ( "-" or "- -" )

However, in my opinion, it makes perfect sense for „numbers", as it can always happen that you don’t want to select a variable and instead want to enter the value, the variable picker would still always pop up - which could be annoying in the long run (the logic is identical for every input/RAW value field).

But there’s a simple “workaround”: search for --900. This should work (at least in 1.10beta).

Best regards,
timmse

1 Like

Hi Valentin,
Good news:

With Bricks 2.0 alpha, now available as a manual download in your account (see changelog), it’s possible to rename CSS variables site-wide.

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment.

2 Likes

This is some good news @timmse! Is this now happening by default or is there some switch you have to tick? Thanks!

No setting needed, just rename the variable in the variable manager, and it should work fine.

1 Like