{"id":384685,"date":"2025-03-03T06:34:22","date_gmt":"2025-03-03T13:34:22","guid":{"rendered":"https:\/\/css-tricks.com\/?p=384685"},"modified":"2025-03-03T06:50:04","modified_gmt":"2025-03-03T13:50:04","slug":"functions-in-css","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/functions-in-css\/","title":{"rendered":"Functions in CSS?!"},"content":{"rendered":"\n
A much-needed disclaimer:<\/em> You (kinda) can use functions now!<\/strong> I know, it isn’t the most pleasant feeling to finish reading about a new feature just for the author to say “And we’ll hopefully see it in a couple of years”. Luckily, right now you can use an (incomplete<\/a>) version of CSS functions in Chrome Canary behind an experimental flag, although who knows when we’ll get to use them in a production environment.<\/p>\n\n\n\n\n\n\n I was drinking coffee when I read the news on Chrome prototyping functions in CSS and… I didn’t spit it or anything. I was excited, but thought “functions” in CSS would be just like mixins in Sass<\/a> \u2014 you know, patterns for establishing reusable patterns. That’s cool but is really more or less syntactic sugar for writing less CSS.<\/p>\n\n\n\n But I looked at the example snippet a little more closely and that’s when the coffee nearly came shooting out my mouth.<\/p>\n\n\n\nArguments, defaults, and returns!<\/h3>\n\n\n
<\/figure>\n\n\n\n