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

font size isn't set #15

Closed lynndylanhurley closed 9 years ago

lynndylanhurley commented 9 years ago

Please correct me if I'm wrong, but my understanding is that this library should shrink text to fit within the width of an element. If I'm mistaken, feel free to close this issue.

issue:

This "lorem ipsum" text should be contained within the dark area.

web view

The text element itself is the width of the dark area (~280px).

code:

// config
angular.module('app')
  .config(function(fitTextConfigProvider) {
    fitTextConfigProvider.config = {
      debounce: _.debounce
    };
  })
<!-- view -->
<h1 data-fittext ng-model='user.name' ng-bind='user.name'></h1>

CSS (from web inspector): CSS View

The following styles are set by this module:

{
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
}

Notice that "font-size" property is absent. The rest of the styles were defined in the CSS of my app.

EDIT: I should also note that no errors have been thrown.

patrickmarabeas commented 9 years ago

Seems like some issues have cropped up recently. Will be looking into it over the next few days hopefully.

lynndylanhurley commented 9 years ago

@patrickmarabeas - thanks! Let me know if you need any more info from me.

olsh commented 9 years ago

@lynndylanhurley probably, the problem is in width: 100%. Try to set it in auto.

patrickmarabeas commented 9 years ago

New version (3.3.0) is out, let me know if you are still having issues. If so, see if you can work off of the demo to narrow down the issue further...