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

WordPress Trac noreply at wordpress.org
Thu Aug 19 20:30:58 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 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.

 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}" --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.

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


More information about the wp-trac mailing list