-
Notifications
You must be signed in to change notification settings - Fork 14
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
Guidelines for sizing of icons that appear with text #1675
Comments
I have now dug through a lot of documentation on this and would like to move forward with attempting to update the Design System documentation to better reflect the design intent and the implementation of this intent in the code. My focus is on the specs for the sizing of icons that appear inline with text(specifically on the web). In order to update the specs I would like to better understand the current state (and the history) of how we size icons that appear next to text on the website. These assumptions and guesses may not reflect the order in which these things happened but I wanted to try and piece this together in the hopes that someone may have some missing pieces to complete the picture. My end goal is for the Design System documentation to have a single set of guidelines for the sizing and alignment of icons that sit inline with text. These guidelines should ideally include design intent, specs, live code examples for each heading and text level (and any special use cases - for example buttons, links, etc.), and documentation that reflects how we implement this in the code. Original Design Manual Sizing Guidelines: New guidelines were added to the Design System on Aug 4, 2020: Content guidelines:
Assumptions
On May 19, 2021, we standardized the height of all icons for the web. We set the art boards and SVG view box height to 19px. (Update all icons to have default 19px height; add new icons; revise some existing icons; add docs for devs #1234 (#1234)) Related issues:Dec 15, 2017 Document new minion standard (cfpb/design-manual#551)
Notes about design intent:Pulled from: cfpb/design-manual#551 (comment)
FEWD - Update the canvas resizing script #577 (cfpb/design-manual#577 (comment))
Update cf-icons to use inline svgs rather than an icon font #752
Sep 18, 2018Huge SVG icons when CSS is disabled (https://github.com/cfpb/capital-framework/issues/863)
On August 23, 2019 the following comment was added to the Design System codebase:
Aug 27, 2020 Make updates to the icon font - "Noun Project"
May 19, 2021 Update all icons to have default 19px height; add new icons; revise some existing icons; add docs for devs #1234 (#1234) - May 19, 2021
The Design System (Iconography)https://cfpb.github.io/design-system/foundation/iconography#behavior
Current state:
Questions:
Design intent (assumptions)
|
Goals (priority order)
Current state for SVG icons:This is my overview of the current state.
Design intentThese are my assumptions about the design intent (which I will pull from to write the guidelines)
Open questions:Question 1:What was the original CSS goal for the sizing of the icons that appear inline with text? To scale down the size of the icons? What exactly were were trying to solve for/accomplish? Question 2:What is the current CSS goal for the sizing of the icons that appear inline with text? To scale up the size of the icons? What are we trying to solve for/accomplish? Related to Question 1 and Question 2:Did we once use the 16/19=1.875em calculation to SCALE DOWN the 1000 x 1200 SVG files and then later use the 16/19=1.875em calculation to SCALE UP the 19px high SVGs? Question 3:What is the current design intent for the sizing of icons that appear inline with text? Is there a size for each heading level or should this be explained more in terms of being related to the height of the text on the webpage? I have some notes on design intent in this respect but no notes on design intent in terms of actual sizes. Question 4:What does this do: process-icon-svgs? Question 5: |
Here are my answers to the open questions from my perspective and historical recollection (caveat: my memory may be faulty):
Correct. Because the SVGs had 1000+ pixel artboards/viewboxes, CSS was required to scale them down to be appropriately sized in comparison to neighboring text.
The current end goal is the same – ensure the icon renders at the proportionate size to the text, regardless of the size of the text. Without the 1.1875em rule, you would have to specify exact icon sizes for each size of text that they could potentially be paired with, which would be quite unwieldy. Using the relative em units also ensures that the proportions remain correct if a user chooses to set a different default text size in their browser.
Yes, but to add a bit of nuance:
I think the answers to the previous three questions essentially answered this, but to be specific: I don't recall there being a specific actual size specified for icons paired with text larger than 16px. We just let the calculation do its thing. Note: I feel like there may be a few one-off instances where icons paired with headings were intentionally made larger than the standard 1.1875em multiplier, but I can't point to any examples off the top of my head.
It takes the SVG code that comes out of Illustrator and removes things that aren't needed for our use, which reduces the filesize, and it also adds two custom classes:
This was a script that I developed to take Illustrator source file artboards, remove any left or right margin from them, and ensure that the vertical positioning of the path within the artboard was consistent. It may not be relevant anymore if the source files' artboards have already been updated to take these things into account. |
@Scotchester Do you recall why the
|
No, I don't! I noticed that the other day and was curious, as well. For some reason, the SVGs were still rendering at 17px wide, according to the dev tools I was looking at, so I guess it should just be left alone! |
If that rule was just for IE's benefit, though, maybe it can be removed entirely. |
@Scotchester @anselmbradford Was that max-width rule just for IE's benefit? If so can we remove it? The widest SVGs are 17px wide. |
Update:I have now published an overhauled Iconography page which should bring us to the current state for how we design, style, and implement icons at the CFPB. Design System - IconographyRemoved:
Added:
Related additions
Changed:
Next steps:
I welcome (and would appreciate) any feedback or suggestions. And a special thanks to @anselmbradford and @meissadia for their collaboration on this update as well as special guest @Scotchester for his historical contributions and feedback. |
@anselmbradford @Scotchester |
The original intent, as you no doubt know, is that we'd support IE much further back in regard to the CSS than in regard to JS. That said, I think if the patterns are kinda broken on legacy IE, but still readable, that's fine. So maybe we'll have unsightly gaps between icons and text in legacy IE. Given Microsoft was abandoned IE support, that seems good enough at this point. |
I'm closing out this issue because we have accomplished the majority of the identified goals. There are longer term next steps for the graphic designers to discuss. These are not urgent so there is no need to keep the issue open. To discuss with designers:
|
Which page is this about?
Design System -- Foundation -- Iconography
Sections:
What kind of issue is this?
Add one or more of the issue labels below to the right-hand sidebar AND issue title.
(We strongly encourage you to make content changes yourself where possible!)
Describe your issue
The Design System has two sets of sizing guidelines for icons that appear with text on the web. Neither of these guidelines match (or at least fully capture) what's happening with the code on the webpage. There is a section called "Content guidelines" that includes guidelines on the sizing and the color of icons with text. There is also a section called "Icons with text" that includes sizing guidelines but these guidelines don't indicate which specific heading levels they apply to. They use terms like "extra small" and "large." In web and in print we pair icons with specific headings and text. Our sizing guidelines should be specific. Additionally we should include examples as live code for all of the potential heading and text combinations.
Size this request (1=tiny, 5=enormous)
I estimate a 4 for figuring out the sizing by heading and writing a plain language explanation of what is happening in the code and what the design and sizing intent is.
Add any additional background info as needed
Thanks. Don't forget to add labels indicating issue type and size before submitting!
Once you've submitted your issue, please add it to the content backlog project board: https://github.com/cfpb/design-system/projects/1
The text was updated successfully, but these errors were encountered: