Search
CSS :nth-of-class selector
23.3.2020
That's not a thing.
But it kinda is!
Bram covers how frustrating .bar:nth-child(2) is. It's not "select the second element of class .bar." It's "select the second element if it also has the class .bar." The good news? There is a real selector that does the former:
:nth-child(2 of .bar) { }
Safari...
Building a Real-Time Chat App with React and Firebase
23.3.2020
In this article, we’ll cover key concepts for authenticating a user with Firebase in a real-time chat application. We’ll integrate third-party auth providers (e.g. Google, Twitter and GitHub) and, once users are signed in, we’ll learn how to store user chat data in the Firebase Realtime Database...
CSS Can Influence Screenreaders
23.3.2020
Ben Myers covers some clear examples of where CSS totally changes what some screen readers announce. For example, some screenreader will see text-transform: uppercase; on a button label that says "Add" and read it like an abbreviation, "A.D.D."
These cases of CSS messing with our screenreader...
Flexible Repeating SVG Masks
22.3.2020
Tyler Gaw reminds us that mask-image can repeat, resize, and move just like background-image does, which is fun to combine and play with. I could see it being a fun option for an <hr, like Sara is doing.
CodePen Embed Fallback
Direct Link to Article — Permalink… Read article...
Auto-Archival
20.3.2020
I'm sure most of us have used the ol' Wayback Machine to access some site that's gone offline. I don't actually know how it decides what sites to archive and when, but you can tell it to save pages. There is UI for it right on its homepage.
Also, there is a little trick...
Typing...
Client-Side Image Editing on Mobile
20.3.2020
Michael Scharnagl:
Ever wanted to easily convert an image to a grayscale image on your phone? I do sometimes, and that's why I build a demo using the Web Share Target API to achieve exactly that.
For this I used the Service Worker way to handle the data. Once the data is received on the client,...
Neumorphism and CSS
20.3.2020
Neumorphism (aka neomorphism) is a relatively new design trend and a term that’s gotten a good amount of buzz lately. It’s aesthetic is marked by minimal and real-looking UI that’s sort of a new take on skeuomorphism — hence the name. It got its name in a UX Collective post from December 2019,...
CSS2JS
20.3.2020
To add inline styles on an element in JSX, you have to do it in this object syntax, like:
<div style={{
fontSize: 16,
marginBottom: "1rem"
}}Content
</div
That might look a little weird to us folks who are so used to the CSS syntax, where it is font-size (not fontSize), margin-bottom...
React Suspense in Practice
19.3.2020
This post is about understanding how Suspense works, what it does, and seeing how it can integrate into a real web app. We'll look at how to integrate routing and data loading with Suspense in React. For routing, I'll be using vanilla JavaScript, and I'll be using my own micro-graphql-react GraphQL...
Consistent Backends and UX: What are the Barriers to Adoption?
19.3.2020
There are very few scenarios in which an eventually consistent database is preferable over a strongly consistent database. Further, in a multi-region application scenario where scaling is necessary, choosing either an undistributed database or an eventually consistent database is even more...
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...
What Does `playsinline` Mean in Web Video?
18.3.2020
I got myself confused about this the other day, went around searching for an answer and came up empty on finding something clear. The answer actually is quite clear and I feel a little silly for not knowing it.
With it in place, like this:
<video src="..." controls playsinline</video
Mobile...
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...
Tools for Optimizing SVG
17.3.2020
This is our straight-to-the-point list of SVG optimizing tools across a number of categories. They are all largely based around SVGO, but how you use it depends. There are web apps, desktop apps, apis, and even design tool add-ons.
The post Tools for Optimizing SVG appeared first on CSS-Tricks
How to Create a “Skip to Content” Link
17.3.2020
Skip links are little internal navigation links that help users move around a page. It’s possible you’ve never actually seen one before because they’re often hidden from view and used as an accessibility enhancement that lets keyboard users and screen readers jump from the top of the page to...
15 Things to Improve Your Website Accessibility
17.3.2020
This is a really great list from Bruce. There is a lot of directly actionable stuff here. Send it around to your team and make it something that you all go through together.
Here's a little one that prodded me to finally fix...
Most screen readers allow the user to quickly see a list of links...
WooCommerce 4.0 & WooCommerce Payments Beta
17.3.2020
Y'all know WooCommerce: it's a plugin for WordPress that adds robust eCommerce functionality to your site. Notably, like WordPress itself, it's open-source and free. You only pay for things if you need things like special plugins that extend functionality.
This is a huge month for WooCommerce!...
How Many Women Users Before Crypto Is Not Sexist?
17.3.2020
A recent headline on Micky — an iconoclastic media outlet that focuses on cryptocurrency — read “Crypto Twitterstorm: ‘Creepy sexist trolling’ or just a funny meme?” The article explained, “A post making fun of Blockstream’s Samson Mow has sparked...