#53874 closed enhancement (fixed)
Bundled Themes: Measurement in 'px' is unnecessary
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Bundled Theme | Keywords: | has-patch |
Focuses: | css, coding-standards | Cc: |
Description
Measurement in 'px' is unnecessary in bundled themes.
Attachments (1)
Change History (19)
#1
@
4 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
@
4 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
@
4 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
@
4 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
@
4 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.
3 years ago
#9
@
3 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
@
23 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()
.
This ticket was mentioned in PR #6541 on WordPress/wordpress-develop by @sabernhardt.
9 months ago
#12
- Keywords needs-refresh removed
- Adds
shorthand-property-no-redundant-values
to Twenty Twenty-One's stylelint rules, which updates some values in the theme's stylesheets with CSS shorthand. - Removes
px
from zero values in Twenty Ten, Twenty Eleven and Twenty Nineteen. - Moves
box-shadow
prefixed rules before the standard property in Twenty Ten. - Removes empty spaces at the ends of lines in Twenty Thirteen, Twenty Nineteen and Twenty Twenty (
measure_px_is_unnecessary_theme_bundle_css_53874.patch
included some of those changes and I found others).
#13
@
9 months ago
Twenty Twenty-One already had the length-zero-no-unit
rule, excluding custom properties, and I added the CSS shorthand rule.
"length-zero-no-unit": [true, {"ignore": ["custom-properties"]}], "shorthand-property-no-redundant-values": true,
Twenty Nineteen and Twenty Twenty seem to require more than just adding the two rules to stylelint settings, so I did not add stylelint to those themes. Linting only found two values to change in Twenty Nineteen years ago, and those are fixed in the pull request.
@mukesh27 commented on PR #6541:
9 months ago
#15
@SergeyBiryukov could you please take a look when you have moment?
#17
@
9 months ago
- Owner set to karmatosed
- Resolution set to fixed
- Status changed from new to closed
In 58178:
@sabernhardt commented on PR #6541:
7 months ago
#18
Committed in r58178
Related: #53866