Reputation: 152945
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.
For example:
This
.class {
padding-right: 10px;
padding-bottom: 15px;
padding-left: 20px;
}
to this
.class {
padding: 0 10px 15px 20px;
}
Upvotes: 3
Views: 2206
Reputation: 72580
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.
Upvotes: 2