This is a minor thing but the css coding standards demands that colors must be set in UPPERCASE which is then the only place where we use UPPERCASE at all in the css. its a little pain but its a pain & theres simply no reason to keep this badpractive, when its standard to write the colors in lowercase

Theres no technical reason to keep it in upper or lower case its actually perfectly valid to even combine these to

  color: #ffffff;
  color: #FfFfFf;
  color: white;

the new css3 rbg(...),rbga(...), hsl(...), hsla(...) is not supported by ie8 - so lets not go there.

Its a minor thing, but theres no reason to keep a dumb thing to do, we all now the prober way to write css, even that we all know that UPPERCASE is awesome ;)
change the [#302199]

.awesomesauce {
  color: #efefef;
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jacine’s picture

I also prefer lowercase, personally. I find it a lot easier to distinguish letters from numbers.

dcmouyard’s picture

+1 for lowercase hex colors

mortendk’s picture

Issue summary: View changes

Updated issue summary.

sun’s picture

Status: Active » Needs review

+1 for lowercase, too.

- Lowercase is easier to read for humans. EVERY TEXT IN UPPERCASE TAKES ADDITIONAL BRAINPOWER TO READ.

- The only app that ever produced uppercase hex colors is PhotoShop. Sometimes I make sure to convert them before saving, sometimes not.

In the end, I don't really care. It should be a recommendation, not a rule.

JurriaanRoelofs’s picture

Theres no technical reason to keep it in upper or lower case its actually perfectly valid to even combine these to

Except that color module is case sensitive when parsing your stylesheet and replacing/shifting colors.

+1 for for lowercase

jvsouto’s picture

Status: Needs review » Active

I also prefer lowercase

cweagans’s picture

Status: Active » Needs review

Resetting status. I have always used uppercase, but I'm not particularly attached to either standard. Doesn't make much difference to me as long as we're consistent in all CSS files in core.

sun’s picture

Title: CSS hex color coding standards lowercase not UPPERCASE » CSS coding standards: Recommend lowercase not UPPERCASE hex colors
Category: bug » task
Issue tags: +Coding standards

Looks like we have an agreement here. Slightly improving the issue title, and adding the more common coding standards tag.

Except that color module is case sensitive

Does that mean there are code changes required for this coding standards change?

JurriaanRoelofs’s picture

Does that mean there are code changes required for this coding standards change?

no it means that it will guarantee color module(s) will always work because it's always lowercase :)

sun’s picture

Status: Needs review » Reviewed & tested by the community

Let's call this RTBC then.

Dries’s picture

I agree with lower-case. There is no patch though. Want me to virtually commit this? :)

aspilicious’s picture

We need to change http://drupal.org/node/302199 but I dan't edit it. Stupid permissions...

Jacine’s picture

Haha, thanks @Dries :)

I can't edit the page either. @sun do you have permission?

sun’s picture

Status: Reviewed & tested by the community » Fixed

Updated accordingly: http://drupal.org/node/302199

Jacine’s picture

Thanks!

mortendk’s picture

awesome thanks :)
... now better go patch go go lowercase

beltofte’s picture

FileSize
9.53 KB

Was a bit faster than the King ;-)

stBorchert’s picture

Status: Fixed » Needs review
FileSize
13.84 KB

Here is a patch that changes all uppercase color codes to lowercase.
While looking through the files I noticed that the rule "Multiple properties should be listed in alphabetical order." does not apply to all css-files in core. Do we want to fix this, too?

---
edit: ups, beltofte was faster

beltofte’s picture

Looks like the patch in #17 is better than mine. I missed some colors in comment_hacks.css.optimized.css.

Another issue I discovered is that both bartik and seven some places are not using shorthand hex codes. It would make sense to fix this too.

beltofte’s picture

Updated my patch with the missing colors in comment_hacks.css.optimized.css + fixing two hex codes in Seven to use shorthand style.

Jacine’s picture

Status: Needs review » Postponed

Hey guys... I'm sorry, but can we wait on this? It would cause some other patches in progress to need to be re-rolled and that would really suck. The plan was not to provide a patch here (that's why it was marked fixed after the docs change was done), but to outline the standard.

beltofte’s picture

No problem :-) We can fix it later.

Jacine’s picture

Yay, thanks so much for understanding! :D

cweagans’s picture

Status: Postponed » Needs review

Just talked with Jacine in IRC. I'm hesitant to just postpone this, lest it fall through the cracks and we never come back to it. So let's postpone this with the stipulation that it will be reopened on Jan 15. That will give the other patches time to land so we don't create conflicts.

cweagans’s picture

Status: Needs review » Postponed

Whoops.

cweagans’s picture

Status: Postponed » Needs review

Reopening per #23.

aspilicious’s picture

Issue tags: -Coding standards, -html5, -css coding standards

#19: hex_colors_lower_case_19.patch queued for re-testing.

KrisBulman’s picture

#19: hex_colors_lower_case_19.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Coding standards, +html5, +css coding standards

The last submitted patch, hex_colors_lower_case_19.patch, failed testing.

KrisBulman’s picture

Assigned: mortendk » KrisBulman
Status: Needs work » Needs review

clearly this standard hasn't been enforced on new commits, I will do a quick clean-up here

KrisBulman’s picture

Component: documentation » CSS
FileSize
20.59 KB

re-rolled, caught a lot more stuff since many new commits have been made.

Status: Needs review » Needs work

The last submitted patch, core-hex_colors_lower_case-1360790-29.patch, failed testing.

KrisBulman’s picture

Assigned: KrisBulman » Unassigned

hmm, I'm having trouble getting the testing module running in my local setup.. until I can get this working, I won't be able to find out the issue.

cweagans’s picture

Looks like the only one that's failing is a color module test. ColorTestCase->_testColor(), to be exact, and the problem stems from the changes made to bartik.

--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.cssundefined
@@ -42,7 +42,7 @@ del {
   text-decoration: line-through;
 }
 tr.odd {
-  background-color: #dddddd;
+  background-color: #ddd;
 }
 img {

Here's an example of the problem. Do not shorten hex color codes from 6 digits to 3 digits, even if it's technically allowed. The ONLY thing that we're doing with this patch is making the letters lowercase.

Jacine’s picture

Thanks Kris :)

I don't think we should touch jQuery UI's code either, since that is an external library. Anyone else have thoughts on that?

cweagans’s picture

Oh yeah, good catch. No changes to jquery javascript or css files please. :)

KrisBulman’s picture

oops! sorry about that, will re-roll

KrisBulman’s picture

Status: Needs work » Needs review
FileSize
13.74 KB

excluded the jquery ui css, should have caught that first time around.

KrisBulman’s picture

sorry, ignore this patch :\ forgot to remove the shortened hex codes.. thought this was ok, since it was mentioned being done in #19

KrisBulman’s picture

Status: Needs review » Needs work
KrisBulman’s picture

ok, no shorthand changes, no external lib changes

cweagans’s picture

Status: Needs work » Needs review

Go testbot, go!

cweagans’s picture

Status: Needs review » Reviewed & tested by the community

Code looks good, tests pass, RTBC.

markabur’s picture

Status: Reviewed & tested by the community » Needs work

Whoops, changed a color here:

 tr.taxonomy-term-divider-bottom {
-  border-top: 1px dotted #CCC;
+  border-top: 1px dotted #eee;
 }
KrisBulman’s picture

Status: Needs work » Needs review
FileSize
12.64 KB

good thing you guys are here to keep me in line

markabur’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

KrisBulman’s picture

This patch will go out of date really quickly considering the amount of different core modules affected.

xjm’s picture

A number of the major bugs are RTBC or to be backported, so hopefully we should below thresholds soon. (Unfortunately the fact that this patch is so prone to needing a reroll is the same reason we might need to wait to commit it until we're back below issue thresholds.) Thanks for staying on top of it!

webchick’s picture

Assigned: Unassigned » jhodgdon

Actually, now that we have a dedicated committer for these kinds of patches, I think they're fine to go in even when we're over thresholds. Just eyeball the RTBC queue first to make sure it's not likely to conflict with anything else in there.

Assigning to Jennifer to take a look at.

xjm’s picture

Er. This isn't a docs patch? I mean, not that it makes any difference really.

webchick’s picture

http://buytaert.net/jennifer-hodgdon

"Her responsibility will be solely around documentation and code style patches" :)

xjm’s picture

OK. :)

KrisBulman’s picture

jhodgdon’s picture

The patch looks fine to me too. I'll look at the RTBC queue and assuming nothing else seems to conflict, get it in hopefully today.

jhodgdon’s picture

There are currently at least 5 issues in the RTBC queue that include CSS files that are also in this patch. They *might* not conflict, but I didn't feel like trying them all... So I guess I'll just wait on this one.

KrisBulman’s picture

k, I'll watch for updates in case a quick re-roll is needed.

jhodgdon’s picture

Assigned: jhodgdon » Unassigned
Status: Reviewed & tested by the community » Fixed

We're under thresholds, so I committed this.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.