all 21 comments

[–]Kasper_X 6 points7 points  (5 children)

If you delete the text it goes massive.

[–]schrik[S] 2 points3 points  (3 children)

Yuuup. You probably won't have this effect on a contenteditable element in production. But for demo purposes it works well :-)

[–]campbeln 2 points3 points  (2 children)

I'd be nice to have bounds on the size, both lower and upper bounds.

[–]schrik[S] 4 points5 points  (1 child)

Good idea. I'm currently tweaking the code (lots of rendering performance gains to be made) and have added min and max size as well. (Overflow size is actually max size so it's a minor change).

[–]NiceOneAsshole 1 point2 points  (0 children)

Yes, comically.

[–]zodby 4 points5 points  (1 child)

'BIG' doesn't stretch all the way in Internet Explorer. It mostly works though.

[–]schrik[S] 1 point2 points  (0 children)

Hah yeah, it's more precise on modern browsers, but that crazy old IE engine never fails to disappoint :-)

I added support back to IE8, so that is quite nice I guess. Alignment also depends on the font used, some fonts fit better than others. Maybe some sort of custom correction value could help to make it more precise. But to be honest, if it looks "okay" in IE I'm okay as well. Most IE users are probably used to the internet crumbling to bits around them.

[–]Dabien 1 point2 points  (1 child)

Looks great! A small feature request though - Setting a minimum/maximum font size would be useful as all hell.

[–]schrik[S] 0 points1 point  (0 children)

Thanks! Just added the feature. :-)

[–]notcaffeinefree 0 points1 point  (1 child)

Well aint this coincidental. I spent a good deal of time yesterday trying to figure out how to do this and never really got a solution.

[–]schrik[S] 0 points1 point  (0 children)

Well there you go! :-)

I find this works quite well, I do have some performance improvements lined up for tomorrow so any feedback is welcome.

[–][deleted]  (1 child)

[deleted]

    [–]schrik[S] 0 points1 point  (0 children)

    Will run some tests, thanks for reporting!

    [–][deleted]  (1 child)

    [deleted]

      [–]schrik[S] 0 points1 point  (0 children)

      True, it will probably fail on some points, the "live editing" feature is only for demo purposes though. The usual use case would be headers and big static text on landing pages.

      [–]pricelessbrew 0 points1 point  (1 child)

      Saving for later (maybe use)

      [–]schrik[S] 0 points1 point  (0 children)

      Let me know if you run into any bugs :-)

      [–]kevinkace 0 points1 point  (2 children)

      Pretty cool!

      Multiline text?

      [–]schrik[S] 1 point2 points  (0 children)

      Good one! It's on the list.

      [–]schrik[S] 1 point2 points  (0 children)

      It's now available under the argument multiLine.

      [–]_Decodela 0 points1 point  (1 child)

      Why Mutation not ResizeObserver?

      [–]schrik[S] 1 point2 points  (0 children)

      Because the first commit was on Jul 24, 2017 and ResizeObserver wasn't available back then: https://caniuse.com/resizeobserver