Closed Bug 1124210 Opened 9 years ago Closed 9 years ago

Color picker hex color values should be copied as lowercase

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
Firefox 44
Tracking Status
firefox44 --- fixed

People

(Reporter: danemacmillan, Assigned: tromey)

References

Details

Attachments

(3 files, 3 obsolete files)

Given that nearly every CSS style guide in existence recommends using lowercase hex color values, the Developer Tools color picker should display all hex color values as lowercase, and more importantly, *copy* them as lowercase. Every time I scan through my code, I know immediately when a color value was copied from the color picker, because it is all in uppercase.

Mind you, even the Inspector's "Rules" and "Computed" tabs display hex color values as all uppercase. Those should be changed, too.

Uppercase hex color values are tantamount to uppercase HTML tags. Those days are behind us.

For reference, here are just a few style guides recommending lowercase hex color values:

Google:
- https://google-styleguide.googlecode.com/svn/trunk/htmlcssguide.xml?showone=Capitalization#Capitalization

jQuery:
- http://contribute.jquery.org/style-guide/css/#formatting

Wordpress:
- https://make.wordpress.org/core/handbook/coding-standards/css/#properties

Codeguide.co:
- http://codeguide.co/#css-syntax
Screencaps confirming bug #1124210 - color picker hex values in upper case in desktop Nightly Firefox Developer (Tools > Web Developer > Inspector)
Flags: needinfo?(work)
This is true - color hex values are displayed upper case in almost all the inspector utilities in Tools for both the Nightly and standard Firefox versions, including the color picker. Have uploaded a tarball of a couple of screenscaps showing this in action.
Attached image bug-1124210-sc2.png
screencap showing color picker hex values in upper case in desktop Nightly Firefox Developer (Tools > Web Developer > Inspector)
Attachment #8553156 - Attachment is obsolete: true
Attached image bug-1124210-sc1.png
screencap showing color picker hex values in upper case in desktop Nightly Firefox Developer (Tools > Web Developer > Inspector)
Flags: needinfo?(work)
As part of as-authored I plan to make this case-preserving.
Additionally, I think switching the default to lower case wouldn't hurt.
Assignee: nobody → ttromey
Status: UNCONFIRMED → ASSIGNED
Depends on: 984880
Ever confirmed: true
Updated more tests.
Attachment #8666878 - Attachment is obsolete: true
Attachment #8667469 - Flags: review?(mratcliffe)
Comment on attachment 8667469 [details] [diff] [review]
preserve color case when using color picker

Review of attachment 8667469 [details] [diff] [review]:
-----------------------------------------------------------------

These files are all my babies so it was nice to see these improvements.

All my fault for using .toUpperCase in css-color.js::hasAlpha().

Great job!
Attachment #8667469 - Flags: review?(mratcliffe) → review+
Updated for change in patch for bug 965181.
Attachment #8667469 - Attachment is obsolete: true
Attachment #8671407 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/a666cafe449f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
See Also: → 1430773
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: