Should the CSS light-dark() Function Support More Than Light and Dark Values? | CSS-Tricks

Should the CSS light-dark() Function Support More Than Light and Dark Values? | CSS-Tricks

One of the newer CSS features that has piqued my interest: the light-dark() function. And I’ve been closely following it ever since it became Baseline back in May 2024. The light-dark() function, briefly If you don’t know, the light-dark() function takes two color arguments: one for light mode and one for dark mode. Hence, the name light-dark(). It toggles between…

Read More
How to Discover a CSS Trick | CSS-Tricks

How to Discover a CSS Trick | CSS-Tricks

Do we invent or discover CSS tricks? Michelangelo described his sculpting process as chiseling away superfluous material to reveal the sculpture hidden inside the marble, and Stephen King says his ideas are pre-existing things he locates and uncovers “like fossils in the ground.” Paragraph one is early for me to get pretentious enough to liken…

Read More
CSS Color Functions | CSS-Tricks

CSS Color Functions | CSS-Tricks

If you asked me a few months ago, “What does it take for a website to stand out?” I may have said fancy animations, creative layouts, cool interactions, and maybe just the general aesthetics, without pointing out something in particular. If you ask me now, after working on color for the better part of the…

Read More
Creating The “Moving Highlight” Navigation Bar With JavaScript And CSS — Smashing Magazine

Creating The “Moving Highlight” Navigation Bar With JavaScript And CSS — Smashing Magazine

In this tutorial, Blake Lundquist walks us through two methods of creating the “moving-highlight” navigation pattern using only plain JavaScript and CSS. The first technique uses the getBoundingClientRect method to explicitly animate the border between navigation bar items when they are clicked. The second approach achieves the same functionality using the new View Transition API….

Read More