[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 12:08:35 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:
------------------------------+-----------------------

Comment (by GaryJ):

 Replying to [comment:40 nacin]:

 >  * `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.

 `//` gets removed by default during the SCSS->CSS compiling, so it never
 makes it into CSS. There's a functional difference at play here, not just
 a code style preference.

 >  * The requirement for a leading 0 for a decimal value (`.1s` or `.25`)
 seems weird.

 That's part of the documented [https://make.wordpress.org/core/handbook
 /best-practices/coding-standards/css/#values WP coding standards for CSS]:
 "Use a leading zero for decimal values, including in rgba()."

 >  * `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.)

 Already documented in the CSS standards as: "Use double quotes rather than
 single quotes, and only when needed, such as when a font name has a
 space.". Custom fonts, using a single name, don't technically need any
 quotes, but some folks favour them for some reason.

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


More information about the wp-trac mailing list