-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hsl(), hsla() and rect() #43
Comments
I'll take the opportunity of this issue and ask why there shouldn't be spaces after commas in |
It is better for readability.
|
@zdroid In your example it is better for readability, but I think this is the only case. Consider following example:
|
I think that Edit: that is my opinion, but not everybody writes code on the same way. |
The guide was updated yesterday to better explain the balance between this and the guideline quoted by @hnrch02.
These two guidelines go hand-in-hand. The goal is to make Here's a longer example of both these rules combined: /* With the space after commas within color values. */
.element {
color: rgba(255, 255, 255, 0.75);
background-color: rgba(0, 0, 0, 0.5);
box-shadow: 0 1px 2px rgba(0, 3px, 6px, 0.15), inset 0 1px 0 rgba(0, 0, 0, 0.5);
}
/* Without the space, but with the space between multiple values. */
.element {
color: rgba(255,255,255,.75);
background-color: rgba(0,0,0,.5);
box-shadow: 0 1px 2px rgba(0,3px,6px,.15), inset 0 1px 0 rgba(0,0,0,.5);
} That's a rather extreme example, and honestly one that doesn't make that much sense color-wise 😆. However, it demonstrates the difference in how the scannability of CSS is affected by too much spacing within property values. And yes, that section should probably be updated to include these other color options and the |
Thanks. 2014-03-05 17:51 GMT+01:00 Mark Otto notifications@github.com:
Zlatan Vasović - ZDroid |
That's a pretty solid point, I still prefer the spaces though, helps for readability IMHO |
If
rgb()
andrgba()
shouldn't have spaces after commas, what abouthsl()
,hsla()
andrect()
?HSL(A) and rect aren't common, but they also shouldn't have the spaces after commas.
The text was updated successfully, but these errors were encountered: