Menu

Creating a flexible and responsive text container
📰

Creating a flexible and responsive text container

DEV Community: css·Giles Webberley·7 days ago
#MU0SvYpy
#devtocss#devto#dev#fittexttocontainer#const
Reading 0:00
15s threshold

When creating my somewhat quirky portfolio site I came across a challenge to make short bits of text resize based on their container size. Although I had just completed a course in React development I wanted to work with Javascript to further my regained comfort with the language. I know lot's of people get frustrated by it's lack of strict typing and all of it's quirks but I always rather enjoyed it and wanted to be creative, which is where it really excels for me.

The project also gave me the opportunity to work further with CSS and catch up with some of the developments that had become available in the many years since I last developed for the web. It seemed that using container queries and the new (to me) container units along with some tweaked clamp() definitions would get me close to achieving the results I wanted, and although it worked for many situations it was a bit of a hack and was not fully responsive.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.