Hi Jaime,
thank you for using Grids!
We’ve just released an update to Grids (version 1.2.28) that allows developers to change the units being used in size controls in Sections and Areas through a filter in your plugin or theme.
For example:
add_filter( 'grids/config', function( $config ) {
$config[ 'general' ][ 'size_units' ] = array(
array( 'label' => 'em', 'value' => 'em' ),
array( 'label' => 'px', 'value' => 'px' ),
array( 'label' => '%', 'value' => '%' ),
array( 'label' => 'rem', 'value' => 'rem' ),
array( 'label' => 'vh', 'value' => 'vh' ),
array( 'label' => 'vw', 'value' => 'vw' ),
);
return $config;
} )
Putting the em
s array as first item in the configuration array will make it the default one when creating a new section with Grids.
Please refer to the config.php
file in the main folder of Grids to get a list of available configuration options.