Closed lumberman closed 8 years ago
Dimension controls already have that. This is an example:
Kirki::add_field( 'kirki_demo', array(
'type' => 'dimension',
'settings' => 'dimension_demo',
'label' => esc_attr__( 'Dimension Control', 'kirki' ),
'description' => esc_attr__( 'In this example we are changing the width of the body', 'kirki-demo' ),
'help' => esc_attr__( 'This is a tooltip', 'kirki-demo' ),
'section' => 'composite',
'default' => '980px',
'priority' => 10,
'output' => array(
array(
'element' => 'body',
'property' => 'width',
),
),
'transport' => 'postMessage',
'js_vars' => array(
array(
'element' => 'body',
'property' => 'width',
'function' => 'css',
),
),
'choices' => array(
'units' => array( '%', 'rem', 'vmax' )
),
) );
Note the choices
argument where you can define an array of units. You can use whatever you want there...
This was not implemented for the typography field, I just added that in the develop branch. :+1:
Hi there,
I'm building theme based on Foundation Framework and these guys advocate using of rem for typography, paddings and margins. With responsive/fluid designs it make great sense.
Can you please add rem to the list of units (px, %, em) or create a filter that we will be able to use to add our custom units from the theme?
Thank you.