In modern web design, we treat fonts as a cornerstone of user experience. They convey brand identity, improve readability, and define a site's aesthetic. However, the methods we use to load these critical assets can dramatically impact performance. As web performance expert Jono Alderson has highlighted, many common font-loading practices actively harm site speed and user perception. This article explores the evolution of web fonts, dives deep into a complete strategy for mastering the @font-face rule, and looks toward the future of this essential technology. The Evolution from "Bulletproof" to WOFF2 The ability to use custom fonts on the web...
The interpolate-size property has been added to CSS to enable smooth animations when transitioning an element's size to or from intrinsic sizing keywords like auto. This post will cover what interpolate-size is, how it works, its limitations, and provide practical examples of how to use it in your web projects. What is interpolate-size? interpolate-size is a CSS property designed to solve a long-standing challenge in web animation: smoothly transitioning an element's dimensions to an intrinsic, content-based size like height: auto. For years, developers have struggled with creating fluid opening and closing effects for components with dynamic content, such as accordion...
Until now generating random values to use in CSS required Javascript to generate the random values and apply them to CSS rules. The CSS Working Group has created two different ways to generate and use random values in CSS independent of Javascript: the @random at-rule currently available in Safari Technical Preview and the proposed random function not currently available. This post covers what the @random rule is, how it differs from the proposed random function, its current limited browser support, and how you can experiment with it today. What is the @random At-Rule The CSS @random at-rule is an experimental...
When working with Typescript, there are times when we need to assert the type of a value to help the compiler understand our intentions. But understanding what assertions are is not always straightforward since there are many different kinds of what Typescript calls assertions. This post will discuss assertions: What they are, how they work, the different kinds of assertions and how they compare to type guards. What are type assertions? Type assertions in Typescript tell the compiler to treat a value as a specific type. It's a way for the developer to say, "I know more about the type...
What it is The ai-summary element is a zero-dependency, progressive enhancement web component that automatically summarizes a given block of text on a webpage. This component is designed to be as efficient as possible by first attempting to use experimental, built-in browser AI capabilities. If those are not available, it gracefully falls back to a high-quality, in-browser model using the transformers.js library. How It Works The component follows a "native-first" approach to ensure the best performance for your users: Native Browser AI Primary Method: The component first checks if the browser supports the experimental Summarizer API. This new API allows...
Rather than using tools like LangChain and LangChart for machine learning, you can use Chrome's built-in AI capabilities for some cases. This post will explore the Built-in AI features of Chrome, how they work, how to enable them and how to use them with third-party fallbacks for browsers that don't support these features. Enabling Gemini Nano in Chrome Get the Right Chrome Version: The version you need depends the API you want to use: For early access to the core createTextSession API, you'll need Chrome 127+ or +higher. For task-specific APIs like Summarizer and LanguageDetector, you'll need Chrome Stable version...
The CSS @function at-rule allows you to create reusable, static functions, making your code more DRY Don't Repeat Yourself, modular, and maintainable. This post covers the @function syntax as implemented in recent Chrome 139+ and as specified in the CSS Custom Functions and Mixins Module Level 1https://www.w3.org/TR/css-mixins-1/ draft. What It Is The CSS @function at-rule is conceptually similar to the SASS @functionhttps://sass-lang.com/documentation/at-rules/function/ at-rule. css @function --function-name--arg1: default, --arg2 returns { / Function body with logic / result: / some computed value /; } The components of the function are: --function-name: The name you use to call the function, prefixed with...
As we write for the web, we face a dual challenge: catering to human readers while also considering how machines will interpret our content. These audiences have very different needs. For humans, you're creating a well-organized, scannable document that respects their time. For machines, you're creating a container of clear, extractable facts or "assertions" that explain the context, meaning, and relationships within your content. Success lies in serving both audiences simultaneously. This post will explore potential ways to synthesize these approaches. Content Structure and Hierarchy The foundation of effective web content is a logical, predictable structure. Machines and human readers...
One of the most inspiring visions for personal computing was Apple's 1987 "Knowledge Navigator" concept video. It depicted a user interacting seamlessly with a digital assistant that could manage schedules, retrieve data, and collaborate on complex tasks. For years, integrating this level of intelligent, stateful interaction into a web application felt like science fiction. I always struggled to bridge the gap between powerful machine learning models and the dynamic, interactive nature of the web. With the introduction of modern machine learning and agents, this has become closer to reality. LangChain.js and LangGraph.js make it even easier to create and interact...
WebGPUhttps://www.w3.org/TR/webgpu/ is a new, modern API that exposes the capabilities of graphics hardware for the web. It is the successor to WebGL and is designed from the ground up to provide better performance, more predictable behavior, and access to advanced features of modern GPUs. This post will look at WebGPU, what it is, how it fundamentally differs from WebGL, and provide practical examples of usage, both directly and through the Three.jshttps://threejs.org/ library. What is WebGPU? WebGPU is a low-level API developed by the W3C GPU for the Web Community Grouphttps://www.w3.org/community/gpu/, which includes major browser vendors like Apple, Google, Mozilla, and...