[wp-trac] [WordPress Trac] #29792: Grunt: Add a precommit task to check for CSS syntax errors

WordPress Trac noreply at wordpress.org
Mon Sep 21 02:49:34 UTC 2015


#29792: Grunt: Add a precommit task to check for CSS syntax errors
------------------------------+-----------------------
 Reporter:  helen             |       Owner:  netweb
     Type:  enhancement       |      Status:  assigned
 Priority:  normal            |   Milestone:  4.4
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+-----------------------
Changes (by nacin):

 * milestone:  Future Release => 4.4


Comment:

 This looks great, @netweb!

 Rule questions:

  * `src/wp-admin/css/colors/_admin.scss:83` uses `//` as a commenting
 style. I know this is allowed in SCSS, but do these rules mandate `//`
 over `/* */`? Should we always use `/* */`, since it's ultimately CSS? I
 don't see what stylelint rule this corresponds to.

  * I noticed the removal of spaces within parentheses. Spacing within
 parentheses is a thing WP likes to do. Can we keep them? I wonder if
 enforcing them ends up being less changes. (This would mean `function-
 parentheses-space-inside: always`.)

  * The requirement for a leading 0 for a decimal value (`.1s` or `.25`)
 seems weird. They get minified out anyway. And, it seems, we omit them all
 over the place. Which is more common in our codebase? What's common in the
 real world? (This would mean `function-parentheses-space-inside: always`).

  * `string-quotes` -- What is more common in our CSS, single quotes or
 double quotes? We already prefer single quotes in JS (unlike the jQuery
 project) and in PHP, so should we just keep using it in CSS too? Is there
 a reason to not be consistent? (I think double quotes look more natural
 when surrounding a font name, I'm just asking.)

 Where we should change our CSS to conform to the rules, rather than add
 ignore rules:

  * We should only ignore `declaration-block-semicolon-newline-after` in
 L10n, and even then, I don't care. (It's actually done on purpose to group
 declarations together, so it's fine.)

  * For `@-webkit-keyframes dice-color-change`, we don't align things the
 way we do for `@-webkit-keyframes customize-reload`. We might as well make
 them standardized so they ignore the same things.

  * We shouldn't ignore `number-zero-length-no-unit`. Remove the units.

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


More information about the wp-trac mailing list