Is there any free online or offline tool to optimize all properties to shorthand form, wherever is possible?
it would be useful to compress big files.
padding: 0 10px 15px 20px;
Your two snippets of CSS are not identical. The second one explicitly sets the top padding to zero, but the first one does not set a top padding so will inherit whatever was specified before.
For example, if you apply the class to a paragraph that already has padding, in the first situation the paragraph will keep its top padding, but in the second you remove it.
So there isn't going to be a tool that does exactly what you want. You'll simply need to write your CSS properly in the first place.