andwhy Posted August 1, 2023 Share Posted August 1, 2023 Hello dear team,  we have been struggling with this for a while now: is there a way to take auto-hyphens into account when splitting a text into lines? With those long German words we always run into this issue unfortunately 🙄  Thanks for you help!  See the Pen Expzoea?editors=1111 by marschiff21 (@marschiff21) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted August 1, 2023 Share Posted August 1, 2023 Hi, Â I believe that there is no way right now to make this work in the way you intend. If you remove all the GSAP code from your example and you inspect the DOM you'll see this: <h1 lang="de">Wir machen Privatversicherungen und Firmenversicherungen.</h1> That's basically what SplitText is getting to work with, so obviously since there are no hyphens there, SpliText doesn't consider them. Â The only way I can think about making this work is to hard code it and use CSS media queries in combination with GSAP MatchMedia to create something similar depending on the screen width using the approach the OP came up with in this thread: Â Sorry I can't be of more assistance. Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
andwhy Posted September 4, 2023 Author Share Posted September 4, 2023 Hm hard coding sadly is not an option, I tried to find some other ways but it seems like the best way is to use shy tags, thank you though! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now