Color Control w/Alpha
-
Hey there,
Using latest version of Kirki: 3.0.16
How can I set the default to be transparent in the color control with alpha?
This is what I use
XXXXXX_Kirki::add_field('xxxxxx_theme_customizer', array( 'type' => 'color', 'settings' => 'xxxxxx_main_sidebar_color_background', 'label' => esc_attr__('Main Sidebar Background Color','xxxxxx'), 'tooltip' => esc_attr__('Change the background color of the Main Sidebar.','xxxxxx'), 'section' => 'xxxxxx_main_sidebar_color_section', 'default' => 'transparent', 'priority' => 1, 'transport' => 'auto', 'choices' => array( 'alpha' => true, ), 'output' => array( array( 'element' => '#right-sidebar', 'function' => 'css', 'property' => 'background-color', ), ), ) );
Reason I ask, when I use it and select a color and plublish it works fine. Then when I hit “Default” to set it back, it keeps the same color that i chose. But if I set the alfa to transparent it takes?
So I was wondering if I would use something like this:
XXXXXX_Kirki::add_field('xxxxxx_theme_customizer', array( 'type' => 'color', 'settings' => 'xxxxxx_main_sidebar_color_background', 'label' => esc_attr__('Main Sidebar Background Color','xxxxxx'), 'tooltip' => esc_attr__('Change the background color of the Main Sidebar.','xxxxxx'), 'section' => 'xxxxxx_main_sidebar_color_section', 'default' => 'rgba(0,0,0,0)', 'priority' => 1, 'transport' => 'auto', 'choices' => array( 'alpha' => true, ), 'output' => array( array( 'element' => '#right-sidebar', 'function' => 'css', 'property' => 'background-color', ), ), ) );
Thanks, I appreciate any help you can give.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Color Control w/Alpha’ is closed to new replies.