[wp-trac] [WordPress Trac] #49638: Determine methodology recommendations for CSS audit

WordPress Trac noreply at wordpress.org
Mon Apr 13 15:00:12 UTC 2020


#49638: Determine methodology recommendations for CSS audit
------------------------------+------------------------------
 Reporter:  notlaura          |       Owner:  (none)
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:  css
------------------------------+------------------------------

Comment (by ryelle):

 I was poking around this over the weekend, and ended up building my own
 auditing tool 😁 It uses `csstree` to parse the CSS and returns more
 detail than Parker's reporting. My script's
 [https://gist.github.com/ryelle/2826510bc24d1dae6b64672ccebe0d88 latest
 output can be found here,] and the [https://github.com/ryelle/css-audit
 audit script itself is here.]

 Some of my numbers are different than Parker's:

 - I'm reporting more colors because Parker only counts hex codes, so
 `rgb(…)`, `rgba(…)` aren't counted.
 - My tool reports fewer IDs because it's calculating the number of
 selectors with IDs, not number of IDs total — an unfortunate number of
 selectors use multiple IDs 😱
 - I created a few other reports that aren't in Parker (like how many
 distinct values does a given property have, how many times is display:none
 used)

 I'm happy to keep working on this, if there's interest — i think writing
 our own audits will let us get very specific about the info needed & how
 to report on it.

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


More information about the wp-trac mailing list