The CSS if()
function enables us to use values conditionally, which we can already do with queries and other functions, so I’m sure you’re wondering: What exactly does if()
do? Let's look at a possible real-world use case.
The CSS if()
function was recently implemented in Chrome 137, making it the first instance where we have it supported by a mainstream browser. Let's poke at it a bit at a very high level.
An introduction to "Color spaces", "Color models", "Color gamuts," and basically all of the "Color somethings" in CSS.
This is the third article in a series about the CSS shape()
function. We've covered drawing lines and arcs in previous articles and, this time, we look specifically at the curve
command and how to use it for drawing complex shapes.
The contrast-color()
function doesn’t check color contrast, but rather it outright resolves to either black or white (whichever one contrasts the most with your chosen color). Safari Technology Preview recently implemented it and we explore its possible uses in this article.
This is the second part of a series that dives deep into the CSS shape()
command, continuing with a more detailed look at the arc
command.
This is the first part of a series that dives deep into the shape function, starting with shapes that use lines and arcs.