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

Icons alignement with webfont #2

Closed
jbelien opened this issue Sep 16, 2020 · 8 comments
Closed

Icons alignement with webfont #2

jbelien opened this issue Sep 16, 2020 · 8 comments

Comments

@jbelien
Copy link

jbelien commented Sep 16, 2020

First things first, great job ! I really love your icons set ! \o/

I migrated one of my projects from Font Awesome to Mono Icons and I love it ...
but the icons are not perfectly aligned with my texts!

You can check it here : https://report.osm.be/
image

What would be the best way to fix that alignment ?

Thanks!

@Wolfr
Copy link
Contributor

Wolfr commented Sep 16, 2020

In this case, I would do

h1 i {
    position: relative;
    top: 6px;
}

For different contexts, a different value will be needed.

@jbelien
Copy link
Author

jbelien commented Sep 16, 2020

For different contexts, a different value will be needed.

That's what I meant, would there be a way to have something that applies to all (most ?) situation ?
Something that would vertically align to the center of the text in the same element ? or align to the "baseline" ?

To be honest, I don't really know what I'm talking about here (ask @evajacobs :P), but when using Font Awesome webfont (for instance), the icons are "magically" aligned correctly (or at least correctly based on what I "expect").

@Wolfr
Copy link
Contributor

Wolfr commented Sep 16, 2020

I see what you mean, perhaps we should take a look at aligning to the baseline of fonts in a better way.

@Wolfr
Copy link
Contributor

Wolfr commented Sep 24, 2020

On the icon font generator package, there is a --center and a --descent flag, something we should experiment with.

@ukaaa
Copy link

ukaaa commented Oct 13, 2020

I gave --descent a try. The results are satisfying. I've made a PR ☝️

--center is used for horizontal centering.

@Wolfr
Copy link
Contributor

Wolfr commented Nov 20, 2020

@ukaaa this is indeed satisfying.

@jbelien sorry for letting you wait for 2 months,

These Svelte REPLs demonstrate the fix:

@Wolfr Wolfr closed this as completed Nov 20, 2020
@jbelien
Copy link
Author

jbelien commented Nov 20, 2020

No worries! Thanks @Wolfr , the update works like a charm 👌

@Wolfr
Copy link
Contributor

Wolfr commented Nov 20, 2020

Haha you already updated it. Nice. I love how the whole icon font generation aspect can live in a package in itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants