patrickmarabeas / ng-FitText.js

An AngularJS directive for inflating web type.
http://patrickmarabeas.github.io/ng-FitText.js
MIT License
222 stars 61 forks source link

Optionally preserve line height #30

Closed trumbitta closed 8 years ago

trumbitta commented 9 years ago

As described on #29, this adds an attribute and configuration to optionally set the line-height to the original font-size value just after the resizing has happened.

This helps when you have several elements of different lengths aligned and want to keep the alignment once they get resized.

Think a grid of big titles getting resized, with small subtitles not getting resized. Without this, the subtitles would end up misaligned to each other on the grid.

patrickmarabeas commented 9 years ago

Awesome! Thanks for the PR - I'll have a look ASAP.

Any chance you could add an example of this functionality to the demo page included so I can quickly get up to speed and confirm I'm on the same page as you?

Thanks!

trumbitta commented 9 years ago

Here you go :)

I'd also like to add some tests, but I couldn't make the suite work :-/

patrickmarabeas commented 9 years ago

Thanks!

Versions may well be incompatible with whatever version of Angular is in there they are so old. Fair warning - I wouldn't think any of the tests would currently pass.

trumbitta commented 9 years ago

Ok, this was my last commit until your feedback :)

Using the original font-size to set the line-height was working for me, just because my line-height was actually 1.

It just occurred to me that using the actual original line-height is more correct :+1:

trumbitta commented 9 years ago

Hey :) any news?

patrickmarabeas commented 8 years ago

Thanks for the PR! I've finally merged in ; )

As a note, I'll be simplifying the functionality to be standard rather than optional (along with the display property and fittext-nl attribute). This will be pushed out in v4.