[wp-trac] [WordPress Trac] #53866: Measurement in 'px' is unnecessary
WordPress Trac
noreply at wordpress.org
Thu Aug 5 08:21:24 UTC 2021
#53866: Measurement in 'px' is unnecessary
------------------------------+------------------------------------
Reporter: ankitmaru | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 5.9
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses: css, coding-standards
------------------------------+------------------------------------
Comment (by netweb):
Replying to [comment:18 mukesh27]:
> @ankitmaru Patch looks good to me.
>
> We should also change/remove `padding: 0 0;` to `padding: 0;` and
`margin: 0 0;` to `margin: 0;` to avoid future tickets.
>
> Here is one instance -
https://github.com/WordPress/WordPress/blob/master/wp-admin/css/nav-
menus.css#L435
Good catch @ankitmaru
Whilst this is documented in the CSS coding standards here:
> https://developer.wordpress.org/coding-standards/wordpress-coding-
standards/css/#properties
> > "Use shorthand (except when overriding styles) for background, border,
font, list-style, margin, and padding values as much as possible. (For a
shorthand reference, see CSS Shorthand.)"
The stylelint `shorthand-property-no-redundant-values` rule is not
currently configured in the `@wordpress/stylelint-config` package.
> https://stylelint.io/user-guide/rules/list/shorthand-property-no-
redundant-values/
It would be great to get the example updated to highlight the incorrect
example with the above here:
> https://github.com/WordPress/wpcs-docs/blob/master/wordpress-coding-
standards/css.md#properties
And to also have this stylelint `shorthand-property-no-redundant-values/`
added to the `@wordpress/stylelint-config` package
> https://github.com/WordPress/gutenberg/blob/trunk/packages/stylelint-
config/index.js
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53866#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list