Non Design System variables injected into variable selection list #36959
ride-guide-steph
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the Problem
When editing an element's styles I am unable to select variables that aren't defined in the Design System.
For example, if I wanted to make use of the WordPress variables from global-styles-inline-css
For size controls I can use the function option to enter something like var(wp--preset--spacing--20), but that's not possible for color controls, and it's not ideal.
Propose a Solution
I can image different possibilities, with varying implications.
1. UI: Allow no value as an option in the Design System.
In my example, this would allow me to add wp--preset--gradient--luminous-dusk as a variable, making it available for selection when editing an element's Style color control. Having 'no value', Elementor could skip it when generating CSS files.
2. Code: Provide a filter in Variables_Service::load() for adding additional variables.
Using this I could add wp--preset--gradient--luminous-dusk to the list of variables available for selection when editing an element's Style color control, without it needing to be in the Design System.
Since Variables_Service::load() is also used for the Design System, there'd either need to be some separation between the two, or the added variables get marked as 'non editable'.
3. Add the 'fx' custom-unit mode to Color (and Font) controls
Not ideal.
In all instances, if I want to override wp--preset--gradient--luminous-dusk with another color, I can already add that as a variable in the Design System, but there's currently no way for it to be available and default to what's in global-styles-inline-css
Additional Context
My real-world context is that I have set of core variables used through the site that establish defaults. I'd like these to be available in Elementor's atomic editor for setting style values, and only added to the Design System when the default is being superseded.
I could add them all to the Design System, but this would add maintenance debt.
Agreement
All reactions