Skip navigation
CSS Tip! 🔮 Wanna make that ring text effect?
0:00 / 0:59

CSS Tip! 🔮 Wanna make that ring text effect?

jhey ʕ•ᴥ•ʔ

@jh3yy149K followers

Visit on X
1,691 likesDownloadOriginal post

118,004 views

CSS Tip! 🔮 Wanna make that ring text effect? 💅 You can do it with trig functions 🤓 .ring { --a: calc(360 / var(--chars)); --r: calc(1 / sin(var(--a))) * -1ch; } .char { transform: rotate(calc(var(--a) * var(--idx))) translateY(var(--r)); } CodePen.IO link below! 👇

10 Comments

Comments from the original post on X (Twitter)

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Here's that @CodePen link! 🚀 For the "Only CSS" powered version, you'll need to be in a supported browser. But, it's unlikely you'll need a dynamic ring so you could copy and paste the HTML 😉 h/t to @FrontRowGreg for getting me to change the UI 🙏

    26 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    Wrote up a little something about different approaches for CSS text rings on the web ✨ And it's on my new site 👀 👉

    30 likes

  • jhey ▲🐻🎈's profile picture

    @jh3yy

    OK. And here's the link again because I wanna see if the OG images are working (Built with Netlify Edge functions 👀)

    6 likes

  • Brandon McConnell's profile picture

    @branmcconnell

    @CodePen Nice! I did this a while back for my profile pic. It doesn't wrap all the way around anymore. Not sure what changed there, but the effect is still there 👋🏼

    14 likes

  • Kevin ⨀'s profile picture

    @kvncnls

    @CodePen Wait... Can we finally do this with just code, now? I've been doing this with SVGs for the longest time. 😅

    4 likes

  • Yousuf Iqbal's profile picture

    @yousufiqbal_dev

    @CodePen CSS is a programming language

    2 likes

  • Sam Holguin's profile picture

    @samsaholguin

    @CodePen My head goes pop when I read “sin”

    1 like

  • trav's profile picture

    @techsavvytravvy

    @CodePen

    1 like

  • 'TeK' ⭐⭐⭐'s profile picture

    @juanmzalazar

    @CodePen

  • Dan Atkinson's profile picture

    @Danbo

    @CodePen I used to have an svg that did this with multidirectional spirals but it stopped working and I couldn't be bothered to figure out why. It'd be nice to try and see if I could recreate it again, if only for the challenge.