Closed Bug 1517189 Opened 5 years ago Closed 5 years ago

Update toolbox icons to Photon style

Categories

(DevTools :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox66 fixed)

RESOLVED FIXED
Firefox 66
Tracking Status
firefox66 --- fixed

People

(Reporter: fvsch, Assigned: fvsch)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-66b-p2])

Attachments

(2 files, 1 obsolete file)

Attached image Toolbox Icons.svg (obsolete) —
This bug is for implementing the design in:
https://github.com/devtools-html/ux/issues/36

We're updating all toolbox icons to a Photon style (16px icons, 2px main strokes, 1px secondary strokes, rounded). Some discussion is still ongoing for specific icons.

Figma source: https://www.figma.com/file/SvG26G5QeMmQ4iM6BMrfrmrh/Toolbox-Icons
(SVG export will be attached.)
Assignee: nobody → florens
Status: NEW → ASSIGNED
Blocks: 1444299
I have a patch up for a first round of review. The actual SVG paths may change, so we should focus on the CSS changes unless there's a visible bug in some SVG code. Note: there are two icons where I have paths for 2 variants of the same icon, with one commented out. We should remove that ultimately.

On the CSS side:

- Renamed the --theme-toolbar-photon-icon-color variable to remove the "-photon-" part. Virtually all our color variables try to follow Photon guidelines, and this was the only variable with "photon" in it.
- Made the toolbox buttons a bit wider (26px instead of 24px) to account for the visually larger icons (often painted on the full 16px canvas instead of the 14px previously). We could go up to 28px and get fully square buttons.
- Made the toolbox tabs a bit more compact, with 8px of padding on the sides instead of 10px. (We're trying to use 4px, 8px and 20px padding wherever it makes sense to follow the Photon 4px grid, but that's not a strong requirement if we find that we want to keep 10px.)
Attachment #9033917 - Attachment description: Bug 1517189 - Use Photon styling for toolbox icons (inspector, console, etc.); r=nchevobbe → Bug 1517189 - Use Photon styling for toolbox icons (inspector, console, etc.); r=gl
There were two code style issues discussed:

1. Dimensions in the SVG sources. Discussed with :gl and :ntim. Basically we can use either `viewBox="0 0 16 16"` or `width="16" height="16"`, or both. Current icons tend to use both, and some only use viewBox. Using width/height has some benefits because it prevents cases where `<img src="some-icon.svg">` takes 100% of its parent's width (resulting in enormous icons); we size images in CSS, but having width/height is a bit more robust. For reference, the Photon image gallery uses both. For now I've decided to use width/height.

2. Images declared as CSS variables in toolbox.css and only used once. Discussed with :ntim and :birtles. This was apparently done to support the Firebug theme in bug 1265985. Since we don't have the Firebug theme anymore and don't want to support multiple icon sets, it's best to avoid creating useless variables (see also bug 1492008). So I've removed the variables.

For the SVG code style issue, I'm considering updating the docs at https://docs.firefox-dev.tools/frontend/svgs.html with a "template" SVG document looking like:

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="context-fill #0c0c0d">
  <path d="..."/>
</svg>
Correction: I've updated to use both width/height and viewBox to be more consistent with other icons in Firefox which tend to use both, and icons from the Photon icon gallery.

The template SVG document would be:

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="context-fill #0c0c0d">
  <path d="..."/>
</svg>
(In reply to Florens Verschelde [:fvsch] from comment #4)
> Correction: I've updated to use both width/height and viewBox to be more
> consistent with other icons in Firefox which tend to use both, and icons
> from the Photon icon gallery.
> 
> The template SVG document would be:
> 
> <!-- This Source Code Form is subject to the terms of the Mozilla Public
>    - License, v. 2.0. If a copy of the MPL was not distributed with this
>    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0
> 16 16" fill="context-fill #0c0c0d">
>   <path d="..."/>
> </svg>

FYI, the #0c0c0d part acts as a fallback color when context-fill isn't used. I'm not sure it's very useful in our case.
> FYI, the #0c0c0d part acts as a fallback color when context-fill isn't used. I'm not sure it's very useful in our case.

Since we're either providing a context-fill or (for the Debugger) using the icon as an opacity mask, I guess the default black fallback color works too, and we can simplify this bit.

I've filed bug 1517791 to further document and tweak the icon coding style.
Pushed by florens@fvsch.com:
https://hg.mozilla.org/integration/autoland/rev/d37414596419
Use Photon styling for toolbox icons (inspector, console, etc.); r=gl,ntim
Attached image Toolbox Icons.svg
Updating the design document.
(The "Option 1" row is what was implemented in this bug.)
Attachment #9033913 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/d37414596419
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
Whiteboard: [qa-66b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: