rotate()

The CSS rotate() function spins an element either clockwise or counterclockwise in a 2D plane. It is one of many transform functions used in the transform property. For example, using rotate() we can rotate the hand around the clock: .seconds-hand { transform: rotate(var(–deg)); transform-origin: bottom center; } CodePen Embed Fallback For rotating elements tri-dimensionally, consider using rotateX() and rotateY(). Read more…

contrast()

The CSS contrast() filter function increases or decreases the contrast of an element, either making colors pop out more or dulling them to gray. Unlike other filter functions like brightness() or saturate(), contrast() affects both saturation and lightness, keeping only the color’s hue. .low { filter: contrast(50%); } .normal { filter: contrast(100%); } .high { filter: contrast(200%); Read more…

contrast-color()

The CSS contrast-color() function takes a <color> value (as well as a variable) and returns either black or white, whichever is the most contrasting color for that value. In other words, contrast-color() is sort of an accessibility tool for conforming to WCAG contrast requirements. .card { background-color: var(–swatch); color: contrast-color(var(–swatch)); } For example, on the next demo Read more…

Markdown + Astro = ❤️

Markdown is a great invention that lets us write less markup. It also handles typographical matters like converting straight apostrophes (‘) to opening or closing quotes (‘ or ‘) for us. Although Astro has built-in support for Markdown via .md files, I’d argue that your Markdown experience can be enhanced Read more…