I'm generating a dynamic CSS using PHP. I've got individual values looking like:
$padding_top = 10;
$padding_bottom = 10;
$padding_left = 10;
$padding_right = 10;
Now, I would like to generate CSS shorthand for all css rules where shorthand notation is possible. So the above example should turn into:
padding: 10px;
I'm sure there must already be a library for this, but I couldn't find it, and before I start writing a hairy heap of conditional statements, I thought I'd give it a go here first.. Any suggestions as to how to most elegantly achieve this?