Search

Nalezeno "QR code": 1615

The Fastest Google Fonts


When you use font-display: swap;, which Google Fonts does when you use the default &display=swap part of the URL , you’re already saying, “I’m cool with FOUT,” which is another way of saying web text is displayed right away, and when the web font is ready...

A “new direction” in the struggle against rightward scrolling


You know those times you get a horizontal scrollbar when accidentally placing an element off the right edge of the browser window? It might be a menu that slides in or the like. Sometimes we to overflow-x: hidden; on the body to fix that, but that can sometimes wreck stuff like position:...

Flexbox-like “just put elements in a row” with CSS grid


It occurred to me while we were talking about flexbox and gap that one reason we sometimes reach for flexbox is to chuck some boxes in a row and space them out a little. My brain still reaches for flexbox in that situation, and with gap, it probably will continue to do so. It’s worth noting...

Unprefixed `appearance `


It’s interesting how third-parties are sometimes super involved in pushing browser things forward. One big story there was how Bloomberg hired Igalia to implement CSS grid across the browsers. Here’s another story of Bocoup doing that, this time for the appearance property. The story...

CSS fix for 100vh in mobile WebKit


A surprisingly common response when asking people about things they’d fix about anything in CSS, is to improve the handling of viewport units. One thing that comes up often is how they relate to scrollbars. For example, if an element is sized to 100vw and stretches edge-to-edge, that’s...

Offscreen Text for Copy & Paste


The relationship between HTML and CSS is special: mixing content via HTML with presentation from CSS to make an awesome presentation. Sometimes, however, you need to employ CSS tricks solely to enhance functionality. This could be one of those cases. When browsing through the Firefox DevTools...

How to Tame Line Height in CSS


In CSS, line-height is probably one of the most misunderstood, yet commonly-used attributes. As designers and developers, when we think about line-height, we might think about the concept of leading from print design — a term, interestingly enough, that comes from literally putting pieces of lead...

Online Together


(This is a sponsored post.) 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...

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:...

Pseudo-elements in the Web Animations API


To use the Web Animations API (e.g. el.animate()) you need a reference to a DOM element to target. So, how do you use it on pseudo-elements, which don’t really offer a direct reference? Dan Wilson covers a (newish?) part of the API itself: const logo...

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. Looking sharp… in more ways than one. 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...

Dealing With Stale Props and States in React’s Functional Components


There’s one aspect of JavaScript that always has me pulling my hair: closures. I work with React a lot, and the overlap there is that they can sometimes be the cause of stale props and state. We’ll get into exactly what that means, but the trouble is that the data we use to build our UI can...

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: document.title = `${percent}% ${post.title}` Knut’s trick assumes React and installing an additional library. I’m sure...

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. Sometimes pretty basic usage...

Modern CSS Solutions for Old CSS Problems


This is a hell of a series by Stephanie Eckles. It’s a real pleasure watching CSS evolve and solve problems in clear and elegant ways. Just today I ran across this little jab at CSS in a StackOverflow answer from 2013. This particular jab was about CSS lacking a way to pause between...

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: .flex-parent { display: flex; gap: 1rem; } .flex-child { flex: 1; } That’s excellent...

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...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace