Mastodon Feed: Post

Mastodon Feed

Boosted by slightlyoff@toot.cafe ("Alex Russell"):
css@front-end.social ("CSS by T. Afif :verified:") wrote:

CSS Functions will soon be available, and it's time to confuse JS developers (and maybe backend developers) a bit.

No, they are not the same as in JS. Like with CSS properties, the order inside doesn't matter and we can write everything in reverse. 🙃

Demo: https://codepen.io/t%5Fafif/pen/MYwMaYE via @codepen (Chrome-only with experimental flag enabled)

#CSS #HTML

@function --size(--a) {   result: var(--r);   --r: calc(var(--a) * var(--i));   --i: 5; } html {   font-size: --size(5px); }