32 minutes ago · Tech · hide

I like to decouple data from its visual presentation whenever I can. So, if I get “basketball Game”, “basketBall game”, or “BASKETBALL GAME” from an API, and I want it displayed sentence-style as “Basketball game” without any scripting, how do I do that? You might try this: h1 { text-transform: capitalize; } However, this turns “basketball game” into “Basketball Game” with a capitalized “G”. This violates Microsoft’s sentence-capitalization style, and it’s not what I want. Here’s how you transform any capitalization to sentence-style.

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town