corenominal

Full stack web developer, interested in all the things, but especially the web, code, design, Linux, OS X, PHP, WordPress, JavaScript & robots.

Tagged: css

How You Can Use HTML5 Custom Data Attributes and Why image/svg+xml

In this article, I am going to show you how you can use HTML5 custom data attributes. I’m also going to present you with some use cases that you can find helpful in your work as a developer.

I can’t remember when I started using custom data attributes, it has to be five years ago at least, it’s certainly been long enough to wonder what I ever did without them. Anyhow, if you’ve yet to learn about custom data attributes, this article seems as good as any.

Practical CSS Grid: Adding Grid to an Existing Design image/svg+xml

Understanding and using Grid is easier than you might expect. The day Grid support shipped in Firefox 52, I decided on the spur of the moment to convert the basic layout of my personal site to use Grid. And it was a fairly simple process—five minutes to write the grid styles, then 15-20 spent troubleshooting.

It’s good to read a practical guide where CSS Grid has been applied to a real-world site. I hope we get to read more of these in the future.

Using CSS Transitions on Auto Dimensions image/svg+xml

We’ve all been there. You’ve got an element you want to be able to collapse and expand smoothly using CSS transitions, but its expanded size needs to be content-dependent. You’ve set transition: height 0.2s ease-out. You’ve created a collapsed CSS class that applies height: 0. You try it out, and… the height doesn’t transition. It snaps between the two sizes as if transition had never been set.

This helpful post came too late for me, I was there yesterday and I wasted a good few minutes trying to get my head around this frustrating feature. Just think, I could have used that wasted time to do something proper useful, like making another cup of coffee.