Search
How to Animate on the Web With Greensock
13.1.2020
There are truly thousands of ways to animate on the web. We’ve covered a comparison of different animation technologies here before. Today, we’re going to dive into a step-by-step guide of one of my favorite ways to get it done: using GreenSock.
(They don’t pay me or anything, I just really enjoy...
Why do we have different programming languages?
13.1.2020
"But why do I have to learn Python?" She wailed, "I like Scratch!"
"I know," I said, "But there are different programming languages for different sorts of tasks."
"That's stupid" she said
I can empathize with the little girl in Terence Eden's story. In high school, I got super into Turbo Pascal....
Re-creating the ‘His Dark Materials’ Logo in CSS
11.1.2020
The text logo has a slash cut through the text. You set two copies on top of one another, cropping both of them with the clip-path property.
What's interesting to me is how many cool design effects require multiple copies of an element to do something cool. To get the extra copy, at least with...
Water.css
11.1.2020
It's notable that Water.css was the #1 clicked thing from Louis Lazaris' Web Tools Weekly in 2019. It's from a 13-year old developer named Felix!
It's just a little bit of CSS you apply to class-free semantic HTML to give it nice basic responsive styles — the perfect kind of thing for a...
CSS-Only Carousel
10.1.2020
It's kind of amazing how far HTML and CSS will take you when building a carousel/slideshow.
Setting some boxes in a horizontal row with flexbox is easy.
Showing only one box at a time with overflow and making it swipable with -webkit-overflow-scrolling is easy.
You can make the "slides" line...
Things you can do with a browser in 2020
10.1.2020
I edit a good amount of technical articles about the web, and there is a tendency for authors to be super broad in their opening sentence, like "What we're able to do on the web has expanded greatly over the years."
I tend to remove stuff like that because it usually doesn't serve the article well...
Is it better to use ems/rems than px for font-size?
10.1.2020
The answer used to be absolutely yes because, if you used px units, you prevented the text from being resized by the user at all.
But browser zoom is the default method for making everything bigger (including text) these days and it works great even if you use px.
But... Kathleen McMahon really...
Our Learning Partner: Frontend Masters
10.1.2020
I'd like to think there is a lot to learn on CSS-Tricks. But we don't really offer much by the way of courses. You're probably reading this because you just generally read this site, and you land on CSS-Tricks otherwise mostly because you are looking for an answer to some front-end...
Understanding Async Await
9.1.2020
When writing code for the web, eventually you'll need to do some process that might take a few moments to complete. JavaScript can't really multitask, so we'll need a way to handle those long-running processes.
Async/Await is a way to handle this type of time-based sequencing. It’s especially great...
let vs. const
9.1.2020
There are multiple ways to declare variables in JavaScript. We had var, and while that still works like it always has, it is generally said that let and const are replacements to the point we rarely (if ever) need var anymore. This doodle explanation does a pretty good job, if you need...
“All these things are quite easy to do, they just need somebody to sit down and just go through the website”
8.1.2020
I saw a video posted on Twitter from Channel 5 News in the UK (I have no idea what the credibility of them is, it's an ocean away from me) with anchor Claudia Liza asking Glen Turner and Kristina Barrick questions about website accessibility.
Apparently, they often post videos with captions,...
Multi-Thumb Sliders: General Case
8.1.2020
The first part of this two-part series detailed how we can get a two-thumb slider. Now we'll look at a general multi-thumb case, but with a different and better technique for creating the fills in between the thumbs. And finally, we'll dive into the how behind the styling a realistic 3D-looking...
The Auto-Flowing Powers of Grid’s Dense Keyword
8.1.2020
Let's say we're working on the homepage of a news website. You're probably used to seeing some card-based content in a grid layout, right? Here's a classic example, The New York Times:
Yeah, something like that.
There are going to be some cards/elements/boxes/whatever that need to take up more...
The Ultimate Guide to Dark Mode for Email Marketers
7.1.2020
On the regular web (I suppose) we handle "dark mode" with the CSS prefers-color-scheme media query. But, and to nobody's surprise, it's way weirder in the land of HTML email. The weirdness is that across different email clients, they handle the dark mode thing differently, starting with the fact...
Multi-Thumb Sliders: Particular Two-Thumb Case
7.1.2020
This is a concept I first came across a few years back when Lea Verou wrote an article on it. Multi-range sliders have sadly been removed from the spec since, but something else that has happened in the meanwhile is that CSS got better — and so have I, so I recently decided to make my...
Jetpack Slideshow Block
7.1.2020
One of the many (many) useful things that Jetpack does is give you extra-fancy custom blocks in the WordPress block (AKA Gutenberg) editor: a slideshow, business hours, contact info, GIF, Mailchimp, Map, Markdown, Pinterest, Star Rating, Recurring Payments Button, Repeat Visitor, Simple Payments...
How Auto Margins Work in Flexbox
6.1.2020
Robin has covered this before, but I've heard some confusion about it in the past few weeks and saw another person take a stab at explaining it, and I wanted to join the party.
Say you have a flex container with some flex items inside that don't fill the whole area.
See the Pen
ZEYLVEX...
Why every website wants you to accept its cookies
6.1.2020
I'm probably in the minority on this, but I've never ever built one of those "This site uses cookies, here's some kind of explanation of why, and please click this OK button to accept that" bars that feels like they are on half of the internet.
Emily Stewart:
Most of us just tediously click “yes”...
How to Stack Elements in CSS
6.1.2020
If you want to create fantastic and unique visual experiences on the web, you will eventually need two elements to overlap or exist in the same place. You may even just need them to be positioned near or next to each other. Let's go over two different ways to accomplish this, one with the position...
Systems, Mistakes, and the Sea
6.1.2020
Our own Robin Rendle:
[...] folks can’t talk about real design systems problems because it will show their company as being dysfunctional and broken in some way. This looks bad for their company and hence looks bad for them. But hiding those mistakes and shortcomings by glossing over everything...