
Replace JavaScript Dialogs With New HTML Dialog
Here's how to replace JavaScript dialogs with the HTML dialog element with the same functionality as the alert(), confirm(), and prompt() methods.
2,268 articles from CSS-Tricks.

Here's how to replace JavaScript dialogs with the HTML dialog element with the same functionality as the alert(), confirm(), and prompt() methods.

You may want to think twice before using this CSS that attempts to obliterate any motion on a website using prefers-reduced-motion.

Hey! Scheduled Functions are cool! Think of them like a CRON job. I want this code to run every Monday at 2pm. I want this code run every hour on the hour.

Think of color spaces as a physical map where individual colors are points on the map. Gradients walk from one point on the map to the next.

We’ll build a CSS-only slide deck that supports live coding, using native web functionality and modern styling, like CSS scroll snap.

WordPress Block Themes were formally introduced in WordPress 5.9. This article is a deep dive introduction to block themes and full-site editing.

Pedro Santos suggests:

I interviewed Thierry Koblentz, creator of Atomic CSS, to understand the history and background that led to making of the popular CSS framework. Thierry, now

Here's a super classy demo from Michelle Barker over on Codrops that shows how to build a scrollable and draggable timeline with GSAP. It's an interesting

This tutorial will work us through on how to implement user registration, verification, and authentication in React using Firebase.

Before the advent of evergreen browsers, you would need to go to the manufacturer’s website and manually download and install the update.

Jim Nielsen's mom couldn't open a website. Jim worked on confirming the issue and documented how he got to the bottom of it:

The current relevance of TypeScript is undisputed. But as we get into 2022, just how relevant is TypeScript going to be moving forward?

Maggie Appleton gets into what is perhaps the foremost metaphor the web is founded on: paper.

The CSS Scroll-Timeline feature can be used to create a slick reverse scrolling effect. But here's how to do it while honors prefers-reduced-motion.

I found the CSS from-font value for the text-decoration-thickness property. I did a little research what I found (and learned) is interesting.

Say you're on the wrong Git branch with unstaged changes. There are a few to go about switching unstaged changes to a new branch.

TypeScript discriminated unions are types where a key or value can be used to differentiate between the keys and values of several types at once.

Design systems are an entire job these days. Agencies are hired to create them. In-house teams are formed to handle them, shipping them so that other teams

In this article, we look at modern CSS mask techniques to create three fancy CSS borders without having to use a background image.

Say you have three HTML classes, and a DOM element. Your job is to rotate the classes. That is, cycle through classes on the HTML element.

Scroll-triggered events are very useful. There are libraries to create them but let's look at how to do it ourselves with a small handful of JavaScript.

How do you handle component spacing in a design system? Do you add margin directly to the components, or outsource it to another component?

This article covers perspectives on accessibility in web design that could help us bridge the great divide between users and designers/developers.

An aspect of web components is that a JavaScript function is called whenever a web component is added or removed from a page.

SVG is a great image format, so it's nice to able to use it in WordPress. If you're looking to be using SVG in WordPress. , we've got you covered here with all the best options.

Let's look at Node and how it plays alongside npm to install features and tooling as packages in modern front-end web development.

The command line is a place we can type commands to be executed directly by our computer. It’s extremely fast, and ideal for a tool like npm.

In this article, we'll install npm and Node, then make a little sample project to give you real hands-on experience working with the npm basics

Next up in this beginner’s guide to npm is likely why you’re here in the first place: installing npm packages, which uses the `npm install` command.

npm stands for Node Package Manager. In order to get a better understanding of npm, we need to learn what a package manager is and does.

This article provides covers how to install an existing npm project rather than starting from scratch, using a real-life project as an example.

This npm guide helps you understand what npm is, what what makes npm a package manager, and how to use npm from a beginner's view.

npm is short for Node Package Manager. Let's unpack exactly the meaning of npm and get an idea of how it fits into modern front-end development.

npm commands run various tasks for you, either as a one-off or a continuously running process for things like starting a server or compiling code.

CSS3 was a massive success for CSS. No doubt loads of people boned up during that time. How has CSS changed since? Let's count the ways.

We can create a life-like dappled light effect In CSS, adding a magic touch to what might otherwise be drab walls of content to bring them back to life.

There are a number of options for including a Table of Contents block in WordPress, including several plugins, or trying to do it yourself.

The VitePWA plugin adds a service worker that handles offline support, caching assets, and prompting users when new content is available.

A complete list of the most popular front-end tools in 2021, according to the Web Tools Weekly newsletter. See which resources made the list.

The CSS Me Not bookmarklet lets you see all of the CSS files on a site, notably unused files you might want to prevent from loading.

I saw some Mondrian Art in CSS going around the other day and figured I'd go looking for others I've seen over the years and round them up.

The Svelte transition API provides a way to animate components when they enter or leave the document, including custom Svelte transitions.

Every so often, I accumulated a bunch of links about various things I find interesting. Accessibility is one of them! Here are 8 helpful accessibility links.

Sass offers functions and mixins that accept parameters. You can use Sass default parameters, that is, parameters that have a value even if you don't provide

You know how you can get cardboard boxes that come totally flat? You fold ‘em up and tape ‘em to make them into a useful box. Then when it’s time to recycle

I don't feel confident operating or maintaining open source. That makes me scared of it, and my fear makes me avoid doing it at all.

Netlify Identity is a robust offering that provides authentication on a Jamstack site. It’s super easy to enable and opens up a bunch of possibilities.

Hot off the presses from Devon Govett, creator of Parcel, is Parcel CSS, a CSS parser, transformer, and minifier written in Rust.

Sometimes UI elements, like tooltips, need to be edge-aware to prevent the content inside from triggering weird scrollbars or cutting off content.

Vite (pronounced “veet”) is a newish JavaScript bundler. It comes batteries-included, requires almost no configuration to be useful, and includes plenty of

Chromium isn't actually just the core browser stuff where Chrome then adds stuff on top of it.

If you’re disciplined and make use of the inheritance that the CSS cascade provides, you’ll end up writing less CSS. But because our styles often comes from

Custom Fields in WordPress are arbitrary bits of data that you can apply to Posts, Pages, and Custom Post Types in WordPress. Metadata, as it were, in the

A list of typography links to other articles about that we've been collecting and are now sharing around the world of fonts, typefaces, and more.

I was killing some time browsing my CodePen feed for some eye candy and didn't need to go past the first page before spotting a neat CSS hover effect by Adam

There is an easy-to-use CSS container query polyfill now. You essentially conditionally load it and forget about it. Then write spec-compliant container queries code.

I was working on a client project a few days ago and wanted to create a certain effect on an <img>. See, background images can do the effect I was

We recently talked with Elad Shechter on his new CSS reset, and shortly after that Josh Comeau blogged his.

We're going to make a Yarn workspaces-based monorepo that supports multiple frameworks, including React, Vue, Svelte, and Angular.