storybook-addon-cssprops
storybook-addon-cssprops copied to clipboard
Provide unit option for range and numeric control types
When using the range
or number
control, it applies a numeric value directly as the CSS variable, however in most cases this isn't going to be applicable in most CSS variables.
'section-spacing-sm': {
control: 'range',
},
Using the range sets: --section-spacing-sm: 5;
. It would be fantastic if a unit value could be provided, for example:
'section-spacing-sm': {
control: 'range',
unit: 'px'
},
This way when the CSS variable is set, it appropriately appends the unit type: --section-spacing-sm: 5px;