Giter VIP home page Giter VIP logo

Comments (4)

joaorodrs avatar joaorodrs commented on May 22, 2024 1

What I meant is that should be a discussion whether word-break: break-all should be applied when noOfLines caused the text to clamp.

from chakra-ui.

HaleyWardo avatar HaleyWardo commented on May 22, 2024 1

What I meant is that should be a discussion whether word-break: break-all should be applied when noOfLines caused the text to clamp.

Thank you for clarifying! I 100% agree and would love to move forward with that discussion. Seems like it would be a good improvement.

from chakra-ui.

joaorodrs avatar joaorodrs commented on May 22, 2024

Hey Haley! Thanks for your contribution.

I observed that by default, when using -webkit-line-clamp, it uses the CSS initial value word-break: normal, which does not break words when clamping text, the same behaviour seen in the noOfLines={n} ChakraUI prop.

I think it would be wise to start a discussion about this change, because at the same time it makes more sense to use word-break: break-all every time noOfLines is applied, it would overwrite the default CSS value when trying to break lines (which is word-break: normal).

What do you think of this?

from chakra-ui.

HaleyWardo avatar HaleyWardo commented on May 22, 2024

Hey Haley! Thanks for your contribution.

I observed that by default, when using -webkit-line-clamp, it uses the CSS initial value word-break: normal, which does not break words when clamping text, the same behaviour seen in the noOfLines={n} ChakraUI prop.

I think it would be wise to start a discussion about this change, because at the same time it makes more sense to use word-break: break-all every time noOfLines is applied, it would overwrite the default CSS value when trying to break lines (which is word-break: normal).

What do you think of this?

Yeah, I think a discussion would be a good start. Are you saying that you think word-break: break-all should be applied when noOfLines is provided no matter the number of lines? If that is the case, we would get something that looks like this:

Screenshot 2024-03-06 at 10 03 47 AM

Which would be an unexpected behavior unless we hyphenate the words.

from chakra-ui.

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.