Skip to content
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

font-size < 10px doesn't work em on Chrome #262

Closed
BcRikko opened this issue Jan 29, 2019 · 7 comments · Fixed by #264
Closed

font-size < 10px doesn't work em on Chrome #262

BcRikko opened this issue Jan 29, 2019 · 7 comments · Fixed by #264
Assignees
Labels
bug Something isn't working released

Comments

@BcRikko
Copy link
Member

BcRikko commented Jan 29, 2019

Describe the bug
Does not see icons less than 10px on Chrome.

Expected behavior

Screenshots
2019-01-29 17 48 49

Environment:

  • OS: macOS High Sierra
  • Browser: Chrome 71

Suggestion(s) for fixing this issue

Use transform: scale(xx) instead of em.

.nes-icon {
  &.is-small {
    transform: scale(0.5);
  }
  &.is-medium {
    transform: scale(1.5);
  }
  &.is-large {
    transform: scale(2);
  }
  &.heart {
    @include pixelize(...);
  }
}
@BcRikko BcRikko self-assigned this Jan 29, 2019
@BcRikko BcRikko added the bug Something isn't working label Jan 29, 2019
@guastallaigor guastallaigor mentioned this issue Jan 29, 2019
10 tasks
@BcRikko
Copy link
Member Author

BcRikko commented Jan 29, 2019

ref #215


em

@BcRikko BcRikko changed the title Icon less than 10px on Chrome font-size < 10px doesn't work em on Chrome Jan 29, 2019
@BcRikko
Copy link
Member Author

BcRikko commented Jan 29, 2019

transform: scale() is not good. 😭

<h1>Original</h1>
<div class="container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
<div class="box">5</div>
</div>

<h1>transform: scale()</h1>
<div class="container scaled">
<div class="box">scale(1)</div>
<div class="box">scale(1.3)</div>
<div class="box">scale(1.5)</div>
<div class="box">scale(1.3)</div>
<div class="box">scale(1)</div>
</div>

<h1>margin-right, margin-bottom</h1>
<div class="container margined">
<div class="box">scale(1)</div>
<div class="box">scale(1.3)</div>
<div class="box">scale(1.5)</div>
<div class="box">scale(1.3)</div>
<div class="box">scale(1)</div>
</div>
* { box-sizing: border-box; }

.box {
  display: inline-block;
  width: 100px;
  height: 100px;
  border: 2px solid;
  transform-origin: top left;
}

.scaled {
  > .box:nth-child(1) {
    transform: scale(1);
  }
  > .box:nth-child(2) {
    transform: scale(1.3);
  }
  > .box:nth-child(3) {
    transform: scale(1.5);
  }
  > .box:nth-child(4) {
    transform: scale(1.3);
  }
  > .box:nth-child(5) {
    transform: scale(1);
  }
}

.margined {
  > .box:nth-child(1) {
    transform: scale(1);
  }
  > .box:nth-child(2) {
    transform: scale(1.3);
    margin-right: 30px;
    margin-bottom: 30px;
  }
  > .box:nth-child(3) {
    transform: scale(1.5);
    margin-right: 50px;
    margin-bottom: 50px;
  }
  > .box:nth-child(4) {
    transform: scale(1.3);
    margin-right: 30px;
    margin-bottom: 30px;
  }
  > .box:nth-child(5) {
    transform: scale(1);
  }
}

2019-01-29 23 50 27

BcRikko added a commit that referenced this issue Jan 30, 2019
BcRikko added a commit that referenced this issue Jan 30, 2019
use transform:scale() instead of font-size & em

fix #262
BcRikko added a commit that referenced this issue Jan 30, 2019
This was referenced Jan 30, 2019
@guastallaigor
Copy link
Member

@BcRikko I could not reproduce this bug. I can see all the icons in all resolutions and zoom types in my Chrome.

Environment

  • OS: Ubuntu 18.10
  • Browser: Google Chrome Version 71.0.3578.98 (Official Build) (64-bit)
  • Build environment (i.e. NodeJS): v10.15.0

Am I missing something?

@BcRikko
Copy link
Member Author

BcRikko commented Jan 31, 2019

How is the following code displayed in your environment?

<h2>font-size: 15px</h2>
<div class="parent" style="font-size: 15px;">
  <div class="child"></div>
</div>
<h2>font-size: 10px</h2>
<div class="parent" style="font-size: 10px;">
  <div class="child"></div>
</div>
<h2>font-size: 5px</h2>
<div class="parent" style="font-size: 5px;">
  <div class="child"></div>
</div>

<style>
.child {
  width: 10em;
  height: 10em;
  background-color: black;
}
</style>

2019-01-31 9 39 14

If it is not the same as the screenshot, could you check the following settings.
chrome://settings/fonts > minimum font size
settings

BcRikko added a commit that referenced this issue Feb 1, 2019
BcRikko added a commit that referenced this issue Feb 1, 2019
use transform:scale() instead of font-size & em

fix #262
BcRikko added a commit that referenced this issue Feb 1, 2019
@guastallaigor
Copy link
Member

guastallaigor commented Feb 1, 2019

The browser configuration is different:

image

If I change the value like your image, I see the bug.
But I thought mine was the default behavior, because for instance if I put like this:

image

All the blocks are going to be the same size:

image

So I'm a bit confused about this, but if you are sure this is a bug I understand it 👍

@BcRikko
Copy link
Member Author

BcRikko commented Feb 2, 2019

Thanks 🙇
Umm.... It seems to be reproduced depending on the language and user settings.

It will be reproduced in the environment of at least Japanese users. 😭
So could you merge #264?

@BcRikko
Copy link
Member Author

BcRikko commented Feb 16, 2019

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants