Search
A Few Background Patterns Sites
18.3.2020
If I need a quick background pattern to spruce something up, I often think of the CSS3 Patterns Gallery. Some of those are pretty intense but remember they are easily editable because they are just CSS. That means you could take these bold zags and chill them out.
CodePen Embed Fallback
My usual...
Playing With Particles Using the Web Animations API
18.3.2020
When it comes to motion and animations, there is probably nothing I love more than particles. This is why every time I explore new technologies I always end up creating demos with as many particles as I can.
In this post, we'll make even more particle magic using the Web Animations API to create...
Flexbox and absolute positioning
18.3.2020
Chen Hui Jing notes that when you absolutely position a flex item, it's no longer part of the flex layout. Except... it kinda is a little bit. If you make the child position: absolute; but don't apply any top/right/bottom/left properties, then flexbox alignment will still apply to it.
It's odd...
A Complete Guide to calc() in CSS
17.3.2020
CSS has a special calc() function for doing basic math. Here's an example:
.main-content {
/* Subtract 80px from 100vh */
height: calc(100vh - 80px);
}
In this guide, let's cover just about everything there is to know about this very useful function.
calc() is for values
The only place you...
Stop Using “Dropdown”
16.3.2020
Adrian Roselli notes that it might actually mean:
A <select> menu
An ARIA Listbox, Combobox, Menu, or Disclosure Widget
An input with a <datalist>
An input with autocomplete
A <details><summary> block
An accordion
Flyout navigation
In my own usage, I tend to mean...
How to Make Repeating Border Images
16.3.2020
I just saw this cool little site from Max Bittker: broider. You design an image on a 9-slice grid (except the middle part) and it will produce an image for you to use with border-image along with the CSS to copy and paste.
Check out my little design:
CodePen Embed Fallback
The areas of the image...
The CSS Podcast
15.3.2020
From Adam and Una at Google, a podcast just about CSS. I believe I'm contractually obliged to link to that! Just one episode out so far, a shorty about the box model.
Last time I wrote up podcasts I like was 8 years ago most of them are dead now, except the biggies like This American Life and...
Negative Margins
9.3.2020
PPK digs into the subject, which he found woefully undercovered in web tech documentation. Our entry doesn't mention them at all, which I'll aim to fix.
Agree on this situation:
This is by far the most common use case for negative margins. You give a container a padding so that its contents have...
JavaScript Libraries Are Almost Never Updated Once Installed
5.3.2020
Some commentary from Zack Bloom on the Cloudflare Blog, looking at requests to CDNJS for versions of jQuery.
What we don’t see is a decline in our old versions which come close to the volume of growth of new versions when they’re released. In fact the release of 3.4.1, as popular as it quickly...
Unfortunately, clip-path: path() is Still a No-Go
2.3.2020
I was extremely excited when I first heard that clip-path: path() was coming to Firefox. Just imagine being able to easily code a breathing box like the one below with just one HTML element and very little CSS without needing SVG or a huge list of points inside the polygon function!
Chris...
Weaving a Line Through Text in CSS
26.2.2020
Earlier this year, I came across this demo by Florin Pop, which makes a line go either over or under the letters of a single line heading. I thought this was a cool idea, but there were a few little things about the implementation I felt I could simplify and improve at the same time.
First off,...
Recreating the CodePen Gutenberg Embed Block for Sanity.io
25.2.2020
Learn how to create a custom CodePen block with a preview for Sanity Studio, inspired by Chris Coyier’s implementation for Wordpress’ Gutenberg editor.
The post Recreating the CodePen Gutenberg Embed Block for Sanity.io appeared first on CSS-Tricks
How to Fetch and Parse RSS Feeds in JavaScript
11.2.2020
Say you have an RSS feed like this one. The goal is to request that RSS feed, parse it, and do something useful with the data in it. RSS is XML, and XML is arguably not as easy to work with than JSON. While a lot of APIs offer JSON responses, it's less typical for RSS, although it does exist.
Let's...
Custom Styling Form Inputs With Modern CSS Features
7.2.2020
It’s entirely possible to build custom checkboxes, radio buttons, and toggle switches these days, while staying semantic and accessible. We don’t even need a single line of JavaScript or extra HTML elements! It’s actually gotten easier lately than it has been in the past. Let’s take a look.
Here’s...
How to Create an Animated Countdown Timer With HTML, CSS and JavaScript
3.2.2020
Have you ever needed a countdown timer on a project? For something like that, it might be natural to reach for a plugin, but it’s actually a lot more straightforward to make one than you might think and only requires the trifecta of HTML, CSS and JavaScript. Let’s make one together!
This is what...
Get Moving (or not) with CSS Motion Path
3.2.2020
We just linked up the idea that offset-path can be cleverly used to set type on a path. Don't miss Michelle Barker's experimentation either, with drawing paths or animating text along a path.
Dan Wilson has also been following this tech for quite a while and points out why the sudden surge...
Four Layouts for the Price of One
29.1.2020
Pretty notable when a tweet about a flexbox layouts gets 8K+ likes on Twitter!
4 layouts for the price of 1, thanks flex ????
css` form { display: flex; flex-wrap: wrap;
& > input { flex: 1 1 10ch; margin: .5rem;
&[type="email"] { flex: 3...
Use and Reuse Everything in SVG… Even Animations!
28.1.2020
If you are familiar with SVG and CSS animations and started to work with them often, here are some ideas you might want to keep in mind before jumping into the job. This article will be about learning how to build and optimize your code with <use> element, CSS Variables and...
Set Type on a Circle… with offset-path
28.1.2020
Here's some legit CSS trickery from yuanchuan. There is this CSS property offset-path. Once upon a time, it was called motion-path and then it was renamed. I sort of rolled my eyes at the time, because the property is so obviously for animating things along a path. But you don't have to use it...
The Modern Lovers
20.1.2020
I love stuff like this.
The Modern Lovers, a rock band in the 70's, play a show in Boston, probably having some poster of their own for the show.
Mike Joyce is inspired by the music and combines his love of it with the design style of Swiss Modernism to create a new poster for it.
Pete Barr...