Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can anyone explain the code in the Utilities API section?

What language is it?

I don't recognise it and this line

   $utilities: () !default;
And the rest of it are unfamiliar to me.


It's SCSS, a language that compiles to CSS. That whole section has almost nothing to do with CSS, though. That's array syntax for holding a set of utilities to be used later in the code.


It's Sass. Compiles to CSS.

It !defaults a $utilities variable to an empty map (if it's not already set to something) and then merges some things into it.

If I had to guess, the snippet is showing you how to declaratively control how width and margin will change for a give class as it's resized.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: