paddingcss properties to their long form. This module is perfect for a
css-in-jslibrary with an atomic approach, deduping all properties to single purpose classes.
If your using
fela for example, you have a plugin like
fela-plugin-unit to add units to your plain numbers. Because fela doesn't understand shorthand properties (like,
padding: 10 5) it also can't prefix them with units. You'll end up with code that'll look a lot like this:
const rule =padding: `px px`
This module seperates
padding into their normalized long form:
const rule =color: propscolor...// expands toconst output =color: 'green'paddingTop: '5px'paddingBottom: '5px'paddingLeft: '10px'paddingRight: '10px'
npm install expand-spacings
The arguments for both
padding() functions work the same as their css definitions: https://developer.mozilla.org/en/docs/Web/CSS/padding
// all sides// vertical, horizontal// top, right, bottom, left