Report non usage of shorthands in CSS

  • Languages of the repository: CSS

Is there an existing rule that checks and reports non usage of shorthands in CSS quality profile, if not can it be added?.

Would be good if this rule would be available as part of CSS quality profiles, so that certain good practices can be enforced.

For better understanding of what my request is about i’m sharing the below piece of code as e.g.

Bad piece of code


{
    padding-left:1em;
    padding-right:1em;
    padding-top:1em;
    padding-bottom:1em;
    margin-left:auto;
    margin-right:auto;
    margin-top:0;
    margin-bottom:0;
}
/*

Good code:

*/
{
    padding:1em;
    margin:0 auto;
}

Kindly let know…

Hi Jerry,

Thank you for bringing this up!

Unfortunately, we don’t have that rule at this time.

We are considering improving the rules we offer for CSS. However, we haven’t committed to a specific plan.

I have created an internal insight to keep this particular rule in mind.

Kind regards,
Gabriel

1 Like