All Blog Posts
Browse the following posts, or view all tags.
-
Published on
Creating a Fluid Type Scale with CSS Clamp
Fluid typography allows each font size in a modular scale to vary responsively between a min and max. Learn the math behind fluid typography and how to programmatically generate a fluid type scale with CSS clamp and Sass.
-
Published on
Modern Techniques for Writing Better CSS
CSS has come a long way since the early days of web development. Learn how to write better CSS using modern strategies like the :is and :where pseudo-class functions, logical properties and values, clamp, gaps, and aspect-ratio.
-
Published on
Managing Keyboard Focus for Load-More Buttons
Load-more buttons are more accessible than infinite scrolling, but they also steal keyboard focus when new content loads in. We can fix this problem by manually focusing the first newly inserted result.
-
Published on
Configuring Web Fonts in 11ty with Global Data
Rather than using static font-face declarations for web fonts, you can take advantage of global data in 11ty to create a single source of truth for fonts and reuse those values in your templates and CSS.
-
Published on
Optimizing Images with the 11ty Image Plugin
While imagery can enrich your content, it can also slow down your site if it's not used responsibly. Learn how to use the official 11ty image plugin to create optimized and responsive images.
-
Published on
Add Comments to a Static Site with Netlify Functions and the GitHub API
Comment systems can be a pain to set up, but they don't have to be. Learn how to use the GitHub Issues API to create a custom comment system powered by Netlify functions.
-
Published on
Managing Complex State in React with useReducer
React's useState hook works well for managing simple state. But once your component starts to grow, useReducer may be a better fit for managing state.
-
Published on
NFTs Are a Problem
While NFTs are being hailed as the future of digital ownership, they're also the source of many problems. NFTs are artificially scarce, make it easier to commit fraud, undermine the intellectual property rights of content creators, and encourage consumptive mining practices.
-
Published on
Accommodating the Longest Text in a Label with CSS Grid
Suppose a label renders strings of different lengths, but you want it to always reserve space for the longest text to prevent layout shifts. You can do this using a CSS grid trick.
-
Published on
Represent State with HTML Attributes, Not Class Names
Developers often use class names to represent a change in a component's state, but this leads to redundant (and sometimes inaccessible) markup. Instead, we should use native HTML attributes to represent state and style those discrete states with the CSS attribute selector.
-
Published on
Passing Object Arguments to Liquid Shortcodes in 11ty
Currently, 11ty doesn't allow you to pass object arguments to shortcodes in Liquid. As a temporary workaround, you can assemble and parse a JSON string to pass along to the shortcode as an argument.
-
Published on
Dynamically Importing Components with React.lazy
Not all static imports are immediately needed, and unnecessary imports can be costly. With React.lazy, you can dynamically import components at run time to reduce the size of your static bundle.
-
Published on
Automate Netlify Redirects in 11ty
Tired of listing all of your Netlify redirects by hand? Generate them programmatically with a bit of 11ty templating magic!
-
Published on
Awaiting Multiple Promises with Promise.all
Often, you need to wait for multiple independent async tasks to finish before resuming where your code left off. Learn how to use JavaScript's Promise.all method to await multiple async operations, such as batch file uploads.
-
Published on
Cleaner Type Predicates with Derived Types
In TypeScript, type predicates allow you to narrow down an abstract type to a more concrete type with a simple assertion. Together with derived types, they can greatly reduce repetition in your code.
-
Published on
The 62.5% Font Size Trick
Once you get used to thinking in rems for font sizing, you'll find that it's easy to express familiar powers of two. But for other values, you may find it helpful to use the 62.5% font size trick.
-
Published on
Don't Use a Fixed Line Height
In typography, the ideal line height for text depends on a variety of factors, including font size, line length, and font family.
-
Published on
11ty: The Good, the Bad, and the... Possum?
An in-depth review of 11ty, an extensible static site generator written in Node that supports a variety of template languages.
-
Published on
Premature Optimization: Code First, Optimize Later
Don't optimize your code just because you have an inkling that it's slow. Focus on writing readable, well-tested, and well-documented code; optimize it if you need to.
-
Published on
React, Iframes, and a Back-Navigation Bug
If an iframe re-renders in React, it can interfere with back navigation in your browser. The solution? Force the iframe to unmount with a unique key.
-
Published on
Make Atomic Git Commits
It can be tempting to lump unrelated code changes into a single commit, but this makes it difficult to debug and time travel in Git. Prefer to write atomic commits that have a single responsibility.
-
Published on
How to Format Code on Save in VS Code with ESlint
Never worry about manually formatting your code again. Improve your developer experience by setting up ESLint to format code on save in VS Code.
-
Published on
CRLF vs. LF: Normalizing Line Endings in Git
Line endings can differ from one OS to another. Learn the history behind CRLF and LF line endings and how to enforce line endings in Git.
-
Published on
Why Developers Should Write
Writing is likely one of the last skills you associate with software development. But it plays a key role in everything that we do and can help you build a more successful career.
-
Published on
Set a Width and Height on Images to Reduce Layout Shifts
Dimensionless images can cause layout shifts as they load, hurting your page's performance. By setting a width and height on images, you allow the browser to initialize an aspect ratio for those images and minimize layout shifts.
-
Published on
Why You No Longer Enjoy Reading
Reading books isn't something that everyone enjoys. But if you used to like reading but can no longer get past the first chapter of a new book, there may be a few reasons why.
-
Published on
Why I Don't Like Tailwind CSS
On paper, Tailwind CSS sounds like a great idea. In reality, it suffers from the same problems that it tries to solve.
-
Published on
SVG Tutorial: How to Code SVG Icons by Hand
Follow along with the examples in this in-depth guide to learn how to draw SVG icons and simple shapes by hand.
-
Published on
Creating a Vertical Rhythm with CSS Grid
Margins are commonly used to space paragraphs in an article, but CSS Grid offers a more intuitive alternative that defines the spacing at the layout level.
-
Published on
Rest in Peace, Flash
If it were up to me, things wouldn't end this way. We had some great times together, but now it's time to say goodbye.