How to register own variable set programmatically

Greenshift has variable system which you can select in each option. You can use Core Framework free plugin to extend them and enable Core framework integration in Greenshift settings – Interface

But also you can do this programmatically. This is example of code

add_filter('greenshift_global_variables', 'my_custom_variable_for_gs');
function my_custom_variable_for_gs($variables){
    if(empty($variables)){
        $variables = array();
    }
    $variables[] = array(
       'label'=> 'XS Size',
       'value'=> "var(--gs--size-xs)",
       'variable' => "--gs--size-xs",
       'variable_value' => "0.85rem",
       'group' => 'size'
    );
    return $variables;
}

This will register variable with label XS Size with key “–gs–size-xs” and value 0.85rem.

There are several predefined groups, they are: size, spacing, color. You can also create own group

«
»