Several years ago, I made a plea to save scoped CSS. One of the top features on my CSS wishlist was on the chopping block, and despite a pretty big push from th
I first got into web design/development in the late 90s, and only as I type this sentence do I realize how long ago that was. And boy, it was horrendous. I mean, being able to make stuff an
The attr() CSS function is used to retrieve the value of an attribute of the selected element and use it in the stylesheet. It can also be used on pseudo-elements, in which case the value of the attribute on the pseudo-element's originating element is returned.
CSS has a great new feature where you can specify the color space to use by adding in to the gradient (not yet supported in Firefox). This is especially useful
CSS has been undergoing a quiet renaissance lately. Lots of big features which previously required an external tool to use, are now native parts of the language, and its growing more and more all the time. If you haven't used CSS in a long time, for whatever reason, now is the time to take a look again.
light-dark() Saw Bramus post about this. :root { color-scheme: light dark; –text-color: light-dark(#333, #ccc); } Apparently, this is just a first step on the way toward a more robust schemed…
Modular CSS and different ways to structure your stylesheets
This week, I’ve written about classless vs. class-based CSS, and how I approach CSS architecture. I’ve also written a fair bit recently about how I’m starting to consider build tools and anti-pattern.
This has led to a few conversations about how to structure CSS and and work with modular files if you’re not using a compiler like Sass. Today, I wanted to talk about that.
Let’s dig in!
Modular files and build tools One of the big benefits of using a build tool like Sass or css-nano is that you break your CSS up into smaller, more modular files, then combine them into one file for deployment.
CSS Grid is an incredibly powerful tool for building layouts on the web, but like all powerful tools, there's a significant learning curve. In this tutorial, we'll build a mental model for how CSS Grid works and how we can use it effectively. I'll share the biggest 💡 lightbulb moments I've had in my own learning journey.
Over the last several years, the way I write CSS has transitioned from a "semantic" approach to something more like what people call "functional CSS." In this post I explain how I got to this point and share some of the lessons and insights I've picked up along the way.
Things You Can Do With CSS Today — Smashing Magazine
The present and future of CSS are very bright indeed and if you take a pragmatic, progressive approach to your CSS, then things will continue to get better and better on your projects, too.
I've long been skeptical of quoting global browser usage percentages to justify their usage of browser features. It doesn't matter what global usage of a
The community-driven resource library of CSS Houdini worklets. Learn about CSS Houdini, its APIs, usage, polyfills, and browser status, to take advantage of the Houdini APIs today.
I’m thoroughly convinced that SVG unlocks a whole entire world of building interfaces on the web. It might seem daunting to learn SVG at first, but you have a
SVG is an image format for vector graphics. It literally means Scalable Vector Graphics. Basically, what you work with in Adobe Illustrator. You can use SVG
Hey! Before you go too far down the rabbit hole of JavaScript-based smooth scrolling, know that there is a native CSS feature for this: scroll-behavior.
Getting JavaScript to Talk to CSS and Sass | CSS-Tricks
JavaScript and CSS have lived beside one another for upwards of 20 years. And yet it’s been remarkably tough to share data between them. There have been large
Form Validation Part 3: A Validity State API Polyfill | CSS-Tricks
In the last article in this series, we built a lightweight script (6kb, 2.7kb minified) using the Validity State API to enhance the native form validation
Form Validation Part 2: The Constraint Validation API (JavaScript) | CSS-Tricks
In my last article, I showed you how to use native browser form validation through a combination of semantic input types (for example, ) and validation
Form Validation Part 1: Constraint Validation in HTML | CSS-Tricks
Most JavaScript form validation libraries are large, and often require other libraries like jQuery. For example, MailChimp's embeddable form includes a 140kb