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.

[Label] Icons should have correct margin when placed after the text

See original GitHub issue

This works:

<a class="ui label">
  <i class="mail icon"></i>
  Mail
</a>

This, almost works (the spacing is off):

<a class="ui label">
  Mail
  <i class="mail icon"></i>
</a>

Here is a screen shot of the difference:

image

Only if I use the delete icon is the spacing as it should be. Here is the code:

<a class="ui label">
  Tag
  <i class="delete icon"></i>
</a>

Here is a screen shot showing the difference in the spacing:

image

Is there any way to get the spacing to work for other icons? If so, can you please let me know how?

Thanks.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ziaratbancommented, Aug 21, 2017

@Banandrew , Your opinion is reasonable. @jlukic override is reasonable but I’m exiting the semantic ui standard.

this is my comment semantic/src/site/elements/label.overrides

.ui.label.icon > .icon{
    margin : 0em @iconDistance 0em 0em;
}

.ui.label.icon[class*="right icon"] > .icon{
    margin : 0em 0em 0em @iconDistance;
}

examples

<div class="ui icon label">
  <i class="mail icon"></i>
  23
</div>

image

<div class="ui right icon label">
  23
  <i class="mail icon"></i>
</div>

image

1reaction
awgvcommented, May 2, 2017

Hi @moshemo,

Sorry for the delay, it’s very easy to fix. Open installation_folder/src/site/elements/label.overrides, put the following there and rebuild the framework:

.ui.label > .right.icon {
  margin: 0em 0em 0em @iconDistance;
}

You can choose your own namespace instead of .right.icon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Space between link and icon, fontawesome - Stack Overflow
It's a good solution in most of the cases, but be aware that it doesn't put the same amount of space between the...
Read more >
Align text or adjust the margins within a text box
Click the text box icon Text box icon , and then click Text Box. You can adjust the left, right, top, and bottom...
Read more >
Tips for Aligning Icons to Text - CSS-Tricks
Tip 2: Use similarly sized icons​​ Here's an ideal situation: all icons are the exact same size. Let's say all the icons in...
Read more >
ARIA24: Semantically identifying a font icon with role="img"
However, they need to be able to perceive icon fonts that are meaningful, ... This example already has a visible text label in...
Read more >
How To Adjust the Content, Padding, Border, and Margins of ...
By default, the margin value of some HTML elements is set to zero, though some elements have specified margin values as their default,...
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