Opened 2 years ago
Last modified 8 months ago
#53874 new enhancement
Bundled Themes: Measurement in 'px' is unnecessary
Reported by: |
|
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)
Change History (12)
#1
@
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
@
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 🤞🏼
#4
@
2 years ago
Thanks for the ticket and patch.
Can you please include Twenty Twenty-One theme changes? I found a similar issue in the below some places.
https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentytwentyone/assets/css/style-editor.css#L227
https://github.com/WordPress/WordPress/blob/master/wp-content/themes/twentytwentyone/assets/sass/01-settings/global.scss#L230
#6
@
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
@
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
@
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.
#11
@
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()
.
Related: #53866