Make WordPress Core

Opened 2 years ago

Last modified 8 months ago

#53874 new enhancement

Bundled Themes: Measurement in 'px' is unnecessary

Reported by: ankitmaru's profile ankitmaru Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch needs-refresh
Focuses: css, coding-standards Cc:

Description

Measurement in 'px' is unnecessary in bundled themes.

Attachments (1)

measure_px_is_unnecessary_theme_bundle_css_53874.patch (10.1 KB) - added by ankitmaru 2 years ago.

Download all attachments as: .zip

Change History (12)

#1 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 5.9
  • Summary changed from Measurement in 'px' is unnecessary in bundled themes. to Bundled Themes: Measurement in 'px' is unnecessary

#3 @netweb
2 years ago

  • Keywords commit added

This looks good, this change is also defined in the WordPress Coding Standards

https://github.com/WordPress/gutenberg/blob/trunk/packages/stylelint-config/index.js#L67

Via the stylelint rule https://stylelint.io/user-guide/rules/list/length-zero-no-unit/

... eventually we'll get stylelint linting core, and passing 🤞🏼

#5 @mukesh27
2 years ago

  • Keywords needs-refresh added

#6 @netweb
2 years ago

  • Keywords commit removed

I've removed commit from here to, running the same commands from the comments in #53866 will help cleanup the shorthand properties in themes too that touch the same lines of code:

#7 @ryelle
2 years ago

Both Twenty Twenty and Twenty Twenty-One have stylelint configs already, so these two rules could also be added to those config files: length-zero-no-unit, shorthand-property-no-redundant-values.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


2 years ago

#9 @audrasjb
2 years ago

As per today's bug scrub, let's move this ticket to Future release since it’s not ready yet, we need new stylelint configs.

#10 @audrasjb
2 years ago

  • Milestone changed from 5.9 to Future Release

#11 @sabernhardt
8 months ago

If we add the stylelint configs, the admin toolbar variable will need an exception. According to ticket:52564#comment:2, the pixel unit is necessary for addition and subtraction in calc().

Note: See TracTickets for help on using tickets.