GithubHelp home page GithubHelp logo

Add maxRows to Text about yamui HOT 4 OPEN

chrismohr avatar chrismohr commented on June 5, 2024
Add maxRows to Text

from yamui.

Comments (4)

unindented avatar unindented commented on June 5, 2024 1

We'll have to consult with @BrendanMcK and our designers, see which option is preferable.

from yamui.

unindented avatar unindented commented on June 5, 2024

Even if you were to correctly calculate the height, how would you introduce the ellipsis?

from yamui.

chrismohr avatar chrismohr commented on June 5, 2024

I'm open to suggestions... I imagine we'd want to consult a designer.

Some options:

Maybe an offset one with a pseudo element?

Or maybe we could progressively enhance and use --webkit-line-clamp for browsers that support it.

Or maybe better would be a fade?

Like this:
https://medium.com/@hey.aaron/truncating-multi-line-content-in-fixed-height-containers-by-fading-7f8ab4635648

Or this:
https://css-tricks.com/text-fade-read-more/

from yamui.

BrendanMcK avatar BrendanMcK commented on June 5, 2024

My understanding is that since the clipping is purely visual, and the DOM still contains all the original text, a screenreader will still read out the full content. That's acceptable in most cases.

OTOH, if the content was significantly larger than the visible portion, we might want to ensure that the screenreader also only reads out text cropped to the same ballpark (ie doesn't need to crop at exact same character, just reads out roughly the same amount).

But if we're confident there won't be more than a few lines here anyhow, that's likely not an issue.

from yamui.

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.