Re:Sass Guidelines
by HugoGiraudel on Tuesday January 06, 2015 @04:24PM
(#8847228)
Actually I am thinking of changing this. Someone brought the issue on GitHub: https://github.com/HugoGiraudel/sass-guidelines/issues/32. It is currently being discussed.
Re:Sass Guidelines
by wldcordeiro on Wednesday January 07, 2015 @01:10AM
(#8849162)
In a similar vein why do you prefer hex colors in shortened lowercase format? I've been partial to uppercase long form.
This is not in a similar vein. Leading zero's for values less than 1 is the correct way to write values less than 1.
3-character or 6-character hex values is only a matter of optimization (fewer characters, which the compiler should be able to handle), and consistency (having both the 3- and 6-character versions in the same file or definition). Case is personal preference and nothing more.
Re:Sass Guidelines
by paulojreis on Wednesday January 07, 2015 @04:27AM
(#8849590)
I agree. Even within the relevant field (front-end development), explicit leading zeros are encouraged. JavaScript code quality tools such as JSHint and JSLint will complain when the leading zero isn't explicit. E.g:
JSHint var foo = .1; // Unexpected '.'.
JSLint var foo = .1; // A leading decimal point can be confused with a dot: '.1'.
Re:Sass Guidelines
by kendallpark on Tuesday January 06, 2015 @05:42PM
(#8847599)
+1
The scientist in me... skin crawls when I see a lack of leading zeros.
The non-American, too - as far as I know only in America people are too lazy to put a zero where it makes sense.
Lazy to use zeroes, yet, pretty active downvoting.
Seconding this. Leading zeros are important for decimals because it is extremely easy to miss a single dot. This is less of an issue in the world of fixed width fonts, but I don't really think that's a valid excuse to buck the trend of every other engineering field.
Re:Sass Guidelines
by HugoGiraudel on Tuesday January 06, 2015 @05:27PM
(#8847528)
It has been updated.
You still have it here:
// Yep
.element {
color: rgba(0, 0, 0, .1);
background: hsl(300, 100%, 100%);
}
// Nope
.element {
color: rgba(0,0,0,.1);
background: hsl( 300, 100%, 100% );
}
Re:Sass Guidelines
by HugoGiraudel on Wednesday January 07, 2015 @03:15AM
(#8849402)
Fixed, thank you very much. :)
Re:Sass Guidelines
by kendallpark on Tuesday January 06, 2015 @05:42PM
(#8847603)
Well done!
If it's to make the resulting css file a byte smaller, shouldn't be the preprocessor be able to strip it out?
[1]: http://sass-guidelin.es/#zeros [2]: http://physics.nist.gov/cuu/pdf/sp811.pdf