[wp-trac] [WordPress Trac] #53866: Measurement in 'px' is unnecessary

WordPress Trac noreply at wordpress.org
Sun Aug 22 07:27:23 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       |     Focuses:  css, coding-standards
----------------------------+------------------------------------

Comment (by netweb):

 Replying to [comment:24 ryelle]:
 > These issues can be autofixed by stylelint, so I created
 [https://github.com/WordPress/wordpress-develop/pull/1604 a PR] that does
 that 🙂 Spot-checking it everything seems OK.

 ✅ Looks good @ryelle, just remove the /vendor changes per @pbiron comment

 > I used the `.stylelintrc.js` in [comment:21], plus a `.stylelintignore`
 file. That way, the command ignores 3rd-party files (from Gutenberg), and
 themes (handled in #53874).
 >
 > {{{
 > ## .stylelintignore
 > # Ignore files that come from Gutenberg.
 > src/wp-includes/css/dist
 > src/wp-includes/blocks
 >
 > # Ignoring themes for now, handle in #53874.
 > src/wp-content/themes
 > }}}
 >
 > With those two files in place, the command to fix is:
 >
 > `./node_modules/.bin/stylelint "src/**/*.{css,scss}"
 --config=.stylelintrc.js --fix`
 >
 > I also ran `npm run build:dev`, to rebuild all the built files. Testing
 again after running these, everything passes the stylelint check (same
 command, without `--fix`) — except `wp-admin/css/themes-rtl.css`. It looks
 like the RTL build process expands the shorthand properties.
 >
 > IMO that's okay since it's a generated file, but if we introduce a
 stylelint config for real, `**/*-rtl.css` and `**/*.min.css` should get
 ignored.

 I started working on a stylelint config and ignore patch to land in the
 /root of the project, I found a couple of bugs in the WordPress stylelint
 config, so I'll get those fixed and a patch added for this in #29792

 That should handle the min & rtl ignores as expected too.

 ----

 Replying to [comment:26 ryelle]:
 > Looks like
 [https://core.trac.wordpress.org/log/trunk/src/js/_enqueues/vendor/tinymce/skins
 those files come to us] like that, so it makes sense to ignore them. I'll
 remove them from my PR.
 >
 > Should I ignore all `vendor/*` files, or just the tinymce files?
 `vendor/crop/cropper.css` & `vendor/thickbox/thickbox.css` are the other
 two altered files, but it looks like those aren't updated in the same way
 as TinyMCE.

 Yes, ignore all the CSS from any `/vendor`s paths:

 In this case, ignore these 5 files:

 - `src/js/_enqueues/vendor/crop/cropper.css`
 - `src/js/_enqueues/vendor/thickbox/thickbox.css`
 - `src/js/_enqueues/vendor/tinymce/plugins/compat3x/css/dialog.css`
 - `src/js/_enqueues/vendor/tinymce/skins/lightgray/content.inline.min.css`
 - `src/js/_enqueues/vendor/tinymce/skins/lightgray/content.min.css`
 - `src/js/_enqueues/vendor/tinymce/skins/lightgray/skin.min.css `

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53866#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list