Sass Mixins For Your Next Project (ddtomorrow.com)
7 years ago from Natalie Fisher, Front End Developer
7 years ago from Natalie Fisher, Front End Developer
Most of these are unnecessary, sure. That aside, I wanna focus on the clearfix()
one real quick. For stuff like this, just have a helper class. Otherwise, you're copying this code snippet into your compiled stylesheet every time you use the mixin.
Instead, if you just make it a class (something like...
.clearfix::after { clear: both; content: ' '; display: table; }
...)
you can use it like <div class="some-element clearfix">foo</div>
, and you're only writing the rule once.
You should take a look at implementing Autoprefixer into your workflow. Doesn't matter if you're compiling using grunt/gulp or a GUI like Codekit, it's simple to set up and would render 4/6 of these unnecessary.
Or you could just use Bourbon.
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now