WordPress-Coding-Standards / stylelint-config-wordpress

WordPress shareable config for stylelint Note: Migrating to Gutenberg repo:

Home Page:https://github.com/WordPress/gutenberg/pull/22777

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help me understand why function-url-quotes is set to 'never' ?

createandcode opened this issue · comments

Hey,

Just getting going with stylelint - thanks for your work on the WP rules!

I'm curious about some of the rules you've set.

'function-url-quotes': 'never', means that I end up with tons of these:
Unexpected quotes (function-url-quotes)

Unexpected quotes (function-url-quotes)

This SO thread https://stackoverflow.com/a/2168861/22837 seems to lean towards using quotes.
I didn't see anything specific in the WP CSS coding guidelines in relation to this.

This one is also problematic for me:
'font-family-name-quotes': 'always-where-recommended'

Wikimedia had a debate on this and landed on always-unless-keyword
wikimedia/stylelint-config-wikimedia#33

which would be what I would lean towards - again, WP guidelines seem non-existent for this too.

Would love to know the rationale for these decisions.

Thanks.

From https://make.wordpress.org/core/handbook/best-practices/coding-standards/css/#values:

Use double quotes rather than single quotes, and only when needed, such as when a font name has a space or for the values of the content property.

... which then follows with an example snippet that contains:

background-image: url(images/bg.png);

In this case, the paths to your font files do not contain a path, and therefore do not require quotes.

@GaryJones - aha! I missed the "and only when needed" bit :)

Thanks!