Search

Nalezeno "calc": 10

Of Course We Can Make a CSS-Only Clock That Tells the Current Time!


Let’s build a fully functioning and settable “analog” clock with CSS custom properties and the calc() function. Then we’ll convert it into a “digital” clock as well. All this with no JavaScript! Here’s a quick look at the clocks … The post Of Course We Can Make a CSS-Only Clock That Tells...

The Raven Technique: One Step Closer to Container Queries


For the millionth time: We need container queries in CSS! And guess what, it looks like we’re heading in that direction. When building components for a website, you don’t always know how that component will be used. Maybe it will be render as wide as the browser window is. Maybe two of them...

Animating Number Counters


Number animation, as in, imagine a number changing from 1 to 2, then 2 to 3, then 3 to 4, etc. over a specified time. Like a counter, except controlled by the same kind of animation that we use for other design animation on the web. This could be useful when designing something like a dashboard,...

When Sass and New CSS Features Collide


Recently, CSS has added a lot of new cool features such as custom properties and new functions. While these things can make our lives a lot easier, they can also end up interacting with preprocessors, like Sass, in funny ways. So this is going to be a post about the issues I’ve encountered...

Creating Color Themes With Custom Properties, HSL, and a Little calc()


Before the advent of CSS custom properties (we might call them “variables” in this article as that’s the spirit of them), implementing multiple color schemes on the same website usually meant writing separate stylesheets. Definitely not the most maintainable thing in the world. Nowadays, though,...

A Complete Guide to calc() in CSS


CSS has a special calc() function for doing basic math. Here's an example: .main-content { /* Subtract 80px from 100vh */ height: calc(100vh - 80px); } In this guide, let's cover just about everything there is to know about this very useful function. calc() is for values The only place you...

Currying in CSS


Funny timing on this I was just looking at the website for Utopia (which is a responsive type project which I hate to admit I don't fully understand) and I came across some CSS they show off that looked like this: :root { --fluid-max-negative: (1 / var(--fluid-max-ratio)...

CSS Variables + calc() + rgb() = Enforcing High Contrast Colors


As you may know, the recent updates and additions to CSS are extremely powerful. From Flexbox to Grid, and — what we’re concerned about here — Custom Properties (aka CSS variables), all of which make robust and dynamic layouts and interfaces easier than ever while opening up many other...

DRY State Switching With CSS Variables: Fallbacks and Invalid Values


This is the second post in a two-part series that looks into the way CSS variables can be used to make the code for complex layouts and interactions less difficult to write and a lot easier to maintain. The first installment walks through various use cases where this technique applies. This post...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace