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

Line height stuck at 18px #226

Closed
justinmanley opened this Issue Apr 24, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@justinmanley

justinmanley commented Apr 24, 2015

Sometimes, I'd like to show text in the browser that is smaller than 16pt.

In some cases, that's because I'd like it to take up less space than 16pt text. At the moment, that's not possible with the Graphics.Element module. Here's what happens when you try to use different font-sizes with Graphics.Element:

elm-line-height

That is, setting the height of Text to a value <16 will change the font-size, but the text will still take up the same amount of space; setting the height to a value >16 will change both the font-size and the amount of space that the text uses.

Is this a bug? I asked about it on elm-discuss and never got an answer.

This behavior is caused by the way that Text is handled by Elm. All Text seems to be wrapped in a <div> which, among other things, has height: 18px. When height is called on a piece of Text, the HTML text is wrapped in a <span> with font-size set to the height before being placed inside this <div>.

Why is the height of the enclosing <div> set to 18px?

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there. I am hoping that'll make it easier to get help with issues like this!

Member

evancz commented May 11, 2016

Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there. I am hoping that'll make it easier to get help with issues like this!

@evancz evancz closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment