Opened 12 years ago
Closed 11 years ago
#22476 closed enhancement (fixed)
Standardize single and double quotes in CSS url()s
Reported by: | TobiasBg | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.9 | Priority: | low |
Severity: | trivial | Version: | |
Component: | Administration | Keywords: | has-patch |
Focuses: | ui | Cc: |
Description (last modified by )
As per http://www.w3.org/TR/CSS2/syndata.html#value-def-uri (and other locations), single quotes '
and double quotes "
in url()
values in CSS like
body { background: url("../img/image.gif");
are optional. Most of core's CSS is already written without such quotes. The patch 22476-remove-quotes-in-url.diff removes the remaining ones, for consistency and to save us some bytes again, even in the minified CSS.
Attachments (8)
Change History (26)
#2
@
12 years ago
Our CSS coding standards have double quotes listed as the style. Personal preferences aside, these decisions came out of long and arduous group discussions. Also, there's already a ticket for CSS standards cleanup: #20570
#3
@
12 years ago
Personally, I don't actually prefer the without-quotes version either. I justed wanted some consistency, and as quotes are optional, and as recent commits with new CSS also left them out, additionally to a lot of url()s already being without them, I decided to go that way in the patch.
It might indeed be better to add " everywhere, according to the Coding Standards, and then maybe hope that the CSS minifier will someday automatically strip them to save the bytes in the .min.css version.
#5
@
12 years ago
Added a new patch because there has been new css added that is also inconsistent. Hope this can go into 3.6
#6
@
12 years ago
- Component changed from General to Administration
- Keywords ui-focus added
- Milestone changed from Awaiting Review to 3.6
- Priority changed from normal to low
- Summary changed from Remove optional single and double quotes in CSS url()s to Standardize single and double quotes in CSS url()s
#7
@
12 years ago
- Cc mdhansen@… added
I think now would be a good time to get this patch in since all the features are now in beta. Once all the css has a standard it will be easier to monitor new patches for this standard.
#9
@
12 years ago
- Keywords commit removed
Hate to do this to you - we (I?) ended up changing the coding standards after all about a month ago: http://make.wordpress.org/core/handbook/coding-standards/css/#values
Use double quotes rather than single quotes, and only when needed, such as when a font name has a space.
I can't quite recall what prompted that change - will link if I have a chance to dig it up.
#10
@
12 years ago
So it seems like the preferred way is without quotes unless necessary. I really do not mind which we use, only that it is consistent. However, the coding standard has been double quotes up until recently. Any users who have adopted double will now be non-standard.
#14
@
11 years ago
The recent commits for the new admin styling in 3.8 added some more inconsistency here :-(
They use single quotes in url()
, while the CSS Coding Standards now use no quotes (in the example).
If somebody states what the current consensus is, I'll gladly refresh the patch for this ticket (best time would be 3.9-early for that, I guess).
Patch removes optional ' and " in CSS url()s