question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some icons have implied padding making them hard to use

See original GitHub issue

Hi, thanks for creating these icons I’ve found them very useful!

However, a lot of them have implied padding making them difficult to work with. By implied padding I mean that the icon does not go to the edge of the svg. As a user my expectation is that the long dimension of the icon goes to the edge of the svg. For example, using a standard 15x15 svg, the size of the GitHub icon is 13.3x12.97, and the size of the Zoom in/out icons are 11x11.

As a user it is easy for me to add padding/margin outside the svg if I need it. And it is also easy to shrink the svg, for example if the Zoom icons were 15x15, but I needed an 11x11 I could just set width="11" height="11". But what is not easy is removing the implied padding if I need the icon to go to the edge of the svg, the only way I found to do this is to use transform: scale(...).

For example, here’s the GitHub icon next the Sun icon (which doesn’t have implied padding): Screen Shot 2021-04-25 at 10 50 02 AM

Here’s the pair with focus styles applied: Screen Shot 2021-04-25 at 10 51 13 AM

Fixed - here’s the pair with transform: scale(1.1333333) applied to the GitHub icon: Screen Shot 2021-04-25 at 10 51 30 AM

Fixed - with focus styles applied: Screen Shot 2021-04-25 at 10 51 43 AM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
colmtuitecommented, Apr 25, 2021

Hey,

The different sizes are intentional. If all icons were the same size, there would be no balance between them.

Different shapes have different perceived sizes. For example, an 11px x 11px square might be perceived as the same size as a 13px x 13px circle.

In other cases, like the GH and Sun icons you showed above, the sun’s larger size is necessary, to create visual effects like the sun’s rays stretching. Similar effects this might work well with would include sparkles, speed/zoom effects, wind blowing etc. For icons that need to communicate movement or activity, they often demand the extra size. For static icons, they can be more contained.

So if we stretched each icon to reach its 15px viewbox edge, the icons would look very imbalanced.

I can assure you that all of the icons are designed meticulously, with no unintentional mistakes. The icons are intended to be used as-is, without any edits.

Does this help?

0reactions
vladmorozcommented, Feb 21, 2022

Closing this as it’s been designed like that very deliberately. However, I did tweak the GitHub icon in the latest version a bit because its white space made it look slightly smaller than other circled icons of the same diameter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Navigation Bar Icon and Padding CSS issues - Stack Overflow
Hi I have a few issues with my navigation bar on my website www.thehungryeurasian.com. 1) I've added icons onto my navigation bar, ...
Read more >
Is there a reason for padding around icons? - Mockups 3
The padding around icons makes it difficult to align them properly with other elements on the page. Here is the Circle Outlined Thin...
Read more >
Increase Spacing Between Lightning-Icon and title
The simplest way to add spacing is by using SLDS CSS classes: <h3 slot ="title" class="slds-card__header-title slds-media__body"> ...
Read more >
Enhancing The Clickable Area Size - Ahmad Shadeed
Once the correct element is used, you need to add enough padding for two reasons: Let the button breath! Make it larger so...
Read more >
10 Most Common Bootstrap Mistakes That Developers Make
Take a look, get some inspiration, and start building your own design variation. Common Bootstrap Mistake #3: Changing Bootstrap CSS file. To make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found