Web Development

Web Development Latest News

css-tricks.com

Online Together

An Event Apart: Online Together is a single-day online conference with an intense focus on digital design, UX, content, code, and more, giving you deep insights into where we are now and where things are going next. AEA! With a brand new online version of their conference! That’s awesome. AEA is a best-in-class web conference, so …

css-tricks.com

Equal Width Columns in CSS Grid are Kinda Weird

Everything is flexible these days. If you write grid-template-columns: 200px 200px 200px;, sure, you’d have equal-width columns, but that’s a rare day. What you usually mean is three columns of equal fluid width. We’ve got fractional units for that, like grid-template-columns: 1fr 1fr fr;. That’s usually fine, but they aren’t very sturdy like pixels. A …

css-tricks.com

React Single File Components Are Here

Shawn Wang is talking about RedwoodJS here: …  it is the first time React components are being expressed in a single file format with explicit conventions. Which is the RedwoodJS idea of Cells. To me, it feels like a slightly cleaner version of how Apollo wants you to do it with useQuery. Shawn makes that …

css-tricks.com

Using CSS Masks to Create Jagged Edges

I was working on a project that had this neat jagged edge along the bottom of a banner image. It’s something that made me think for a second and I learned something in the process! I thought I’d write up how I approached it so you can use it on your own projects.

css-tricks.com

Recent Episodes of ShopTalk Show

There is a super cool new Podcast block for WordPress Gutenberg you use Jetpack (released in 8.5). I wanted to try it out, so below you’ll see recent episodes from ShopTalk Show. I’d tell you all about the recent episodes, except then this blog post wouldn’t age very well, because the point of this blog …

css-tricks.com

Why does writing matter in remote work?

Talk to anyone who has an active blog and I bet they’ll tell you it’s been valuable to them. Maybe it’s opened doors. Maybe it’s got them a job. Maybe it’s got them a conference invite. Maybe they just like the thrill of knowing people have read and responded to it. Maybe they learned a …

css-tricks.com

How I Put the Scroll Percentage in the Browser Title Bar

Some nice trickery from Knut Melvær. Ultimately the trick boils down to figuring out how far you’ve scrolled on the page and changing the title to show it, like: Knut’s trick assumes React and installing an additional library. I’m sure that library does all kinds of smart stuff, but if you’re looking to do this …

css-tricks.com

min(), max(), and clamp() are CSS magic!

Nice video from Kevin Powell. Here are some notes, thoughts, and stuff I learned while watching it. Right when they came out, I was mostly obsessed with font-size usage, but they are just functions, so they can be used anywhere you’d use a number, like a length.

css-tricks.com

Turning a Fixed-Size Object into a Responsive Element

I was in a situation recently where I wanted to show an iPhone on a website. I wanted users to be able to interact with an application demo on this “mock” phone, so it had to be rendered in CSS, not an image. I found a great library called marvelapp/devices.css. The library implemented the device …

css-tricks.com

Chromium lands Flexbox gap

I mentioned this the other day via Michelle Barker’s coverage, but here I’ll link to the official announcement. The main thing is that we’ll be getting gap with flexbox, which means: That’s excellent, as putting space in between flex items has been tough in the past. We have justify-content: space-between, which is nice sometimes, but …

css-tricks.com

prerender.js

This is another player in the game of (pre)rendering the page of the link that you’re about to click on before you click it. The point of which is to get a performance boost for extremely little effort. You’re putting the browser to work getting that next page ready for, say, that half a second …

css-tricks.com

Let’s Take a Deep Dive Into the CSS Contain Property

Compared to the past, modern browsers have become really efficient at rendering the tangled web of HTML, CSS, and JavaScript code a typical webpage provides. It takes a mere milliseconds to render the code we give it into something people can use. What could we, as front-end developers, do to actually help the browser be …

css-tricks.com

I’m getting back to making videos

It’s probably one part coronavirus, one part new-fancy-video setup, and one part “hey this is good for CodePen too,” but I’ve been doing more videos lately. It’s nice to be back in the swing of that for a minute. There’s something fun about coming back to an old familiar workflow.

css-tricks.com

Exciting Things on the Horizon For CSS Layout

Michelle Barker notes that it’s been a heck of a week for us CSS layout nerds. Firefox has long had the best DevTools for CSS Grid, but Chrome is about to catch up and go one bit better by visualizing grid line numbers and names. Firefox supports gap for display: flex, which is great, and …

css-tricks.com

Creating an Accessible Range Slider with CSS

The accessibility trick is using <input type=”range”> and wrestling it into shape with CSS rather than giving up and re-building it with divs or whatever and later forget about accessibility. The most clever example uses an angled linear-gradient background making the input look like a volume slider where left = low and right = high.

css-tricks.com

Working With MDX Custom Elements and Shortcodes

MDX is a killer feature for things like blogs, slide decks and component documentation. It allows you to write Markdown without worrying about HTML elements, their formatting and placement while sprinkling in the magic of custom React components when necessary. Let’s harness that magic and look at how we can customize MDX by replacing Markdown …

css-tricks.com

Static Hoisting

The other day in “Static or not?” I said: … serving HTML from a CDN is some feat. What I meant is that serving resources like images, CSS, and JavaScript from a CDN is fairly straightforward. The industry at large has been doing that for many years. An asset with a URL can be moved …

css-tricks.com

How to Use Block Variations in WordPress

WordPress 5.4 was released not so long ago and, along with other improvements and bug fixes, it introduced a feature called Block Variations. I had a chance to use it on one of my recent projects and am so pleasantly surprised with how smart this feature is. I actually think it hasn’t received the attention …

css-tricks.com

How to Create Custom WordPress Editor Blocks in 2020

Peter Tasker on creating blocks right now: It’s fairly straightforward these days to get set up with the WP CLI ‘scaffold’ command. This command will set up a WordPress theme or plugin with a ‘blocks’ folder that contains the PHP and base CSS and JavaScript required to create a custom block. The only drawback that I noticed is …

css-tricks.com

`lh` and `rlh` units

There’s some new units I was totally unaware of from the Level 4 spec for CSS values! The lh unit is “equal to the computed value of line-height” and rlh is the same only of the root element (probably the <html> element) rather than the current element. Why would that be useful? Šime Vidas’ has …

css-tricks.com

List Style Recipes

Lists are a fundamental part of HTML! They are useful in things like blog posts for listing out steps, recipes for listing ingredients, or items in a navigation menu. Not only are they an opportunity for styling, but they have accessibility implications. For example, the number of items in a list is announced in a …

css-tricks.com

Angular + Jamstack! (Free Webinar)

It’s easy to think that working with Jamstack means working with some specific set of technologies. That’s how it’s traditionally been packaged for us. Think LAMP stack, where Linux, Apache, MySQL and PHP are explicit tools and languages. or MEAN or MERN or whatever. With Jamstack, the original JAM meant JavaScript, APIs, and Markup. That’s …