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

I'll give another example with mixins: clearfix. I've seen webpages littered with class="clearfix" all over the HTML. That doesn't do anybody any good. With a CSS preprocessor you can define a clearfix mixin and just write it something like:

.class-name .clearfix font-size: 1.2em

There are other ways to do it like one long string of selectors followed by the clearfix code, but they're not as convenient or readable.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: