Opened 7 months ago
Last modified 3 weeks ago
#22476 new enhancement
Standardize single and double quotes in CSS url()s
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | Future Release |
| Component: | Administration | Version: | |
| Severity: | trivial | Keywords: | has-patch ui-focus |
| Cc: | mdhansen@… |
Description
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 (6)
Change History (17)
comment:1
MikeHansenMe
— 7 months ago
- Severity changed from normal to trivial
comment:2
helenyhou
— 7 months 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
comment:3
TobiasBg
— 7 months 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.
comment:4
georgestephanis
— 7 months ago
+1 for MikeHansenMe's patch and coding standards.
comment:5
MikeHansenMe
— 4 months ago
Added a new patch because there has been new css added that is also inconsistent. Hope this can go into 3.6
comment:6
SergeyBiryukov
— 4 months 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
comment:7
MikeHansenMe
— 2 months 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.
comment:8
SergeyBiryukov
— 2 months ago
- Keywords commit added
comment:9
helen
— 2 months 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.
comment:10
MikeHansenMe
— 2 months 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.
comment:11
ocean90
— 3 weeks ago
- Milestone changed from 3.6 to Future Release
Patch removes optional ' and " in CSS url()s