Browser: Brave Version 1.73.105 Chromium: 131.0.6778.265 (Official Build) (64-bit)
OS: macOS / Windows 10
URL: N/A
Overview
The absence of error checking or validation on variable values (syntax checking at a minimum!) means that one typo can break a large portion of the variables, with no easy way to figure out where the issue is.
Expected behaviour
If a variable value is invalid, it will be ignored and not included in the list of variables, allowing all other variables to be loaded successfully.
Actual behaviour
If a variable value is invalid, it is included in the global-variables.min.css file as is, resulting in any variables that come after this variable failing to load in the browser.
Steps to reproduce
- Set up a site with a number of variables (at least 10) defined via the Global variables manager.
- Enter an invalid value for a variable at about position 5 .e.g. leave off the closing bracket for a var(–xxxx) value.
- Create content via the builder that uses one of the variable values past position 5 in the list (depends on how the file is written as to which ones will be before or after the invalid value). All variables will be available in the builder, regardless of validity.
- View this content on the front end.
- Inspect the element and view the variable that has been applied, and see that it is undefined.
- View the global-variables.min.css file and see that it has all values included, but that…
- The browser does not recognise any of the variables past the invalid one.
I have spent HOURS trying to figure why my variables were not working, only to finally discover via Firefox, which actually shows the broken CSS (unlike Brave) that there was an invalid value halfway through my variables list.
This was causing half of my variables to fail, and I could not figure out what the issue was. I expected the new variable manager to be more fault-tolerant than this, and there was no alert anywhere about my error that could have allowed me to resolve this issue quickly. Instead I had to resort to workarounds until I could finally track down the bug.