Code Monkey home page Code Monkey logo

Comments (5)

patrickmarabeas avatar patrickmarabeas commented on June 1, 2024

You can do this with <= v2.4.0

<div data-fittext>
    <span>These lines</span>
    <span>will all be the same</span>
    <span>font size</span>
</div>

Can't remember if a line break works as well...

I'll have to see if I can get this working again in v3.0.0 + when I get some time.

from ng-fittext.js.

swashcap avatar swashcap commented on June 1, 2024

Running into a similar problem. Would be nice if you could configure the directive's link function’s hard-coded styles to maybe help this out (the element[0].style.whiteSpace = 'nowrap'; stuff.)

Awesome plugin, btw.

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 1, 2024

Aye, I didn't think about multi-line when including those styles.

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 1, 2024

Line breaks now work in v3.2.0 with min font size specifications, see demo (type in input): http://patrickmarabeas.github.io/ng-FitText.js/ but isn't something you can specify as to where it occurs.

To be able to specify we need to divide the ratio by the number of line breaks. Are you simply using <br>'s? The other option would be to look for data attributes which could be specified on any element...

<span data-fittext>
    <span data-fittext-sub>Line 1</span>
    <span data-fittext-sub>Line 2 that's longer</span>
</span>

Let me know what you think...

from ng-fittext.js.

patrickmarabeas avatar patrickmarabeas commented on June 1, 2024

v3.3.0 adds data-fittext-nl attribute. Wrap each new line in a span/wrapper of some sort and include the attribute. See demo page for example: http://patrickmarabeas.github.io/ng-FitText.js/

from ng-fittext.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.