Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed CSS to Sass!
You have completed CSS to Sass!
Preview
Mixins are a smart way of reusing our code. One of the last steps in refactoring is replacing common patterns in our code with reusable mixins. Let's start by writing a mixin that writes our @font-face declarations
Quick Reference
Related Videos
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
So mixins are a smart way of reusing our
code.
0:00
Because instead of having to rewrite the
common properties,
0:02
or tedious bits of CSS in our project.
0:06
We can write them once and mixin.
0:09
Then let Sass write them dynamically once
we include them.
0:11
And what's also great about creating Sass
mixins
0:14
is that we can reuse them on other
projects if we want.
0:16
Usually, we'll wanna write mixins that
make use of arguments to dynamically alter
0:20
CSS values.
0:24
Instead of ones that just repeat blocks of
code.
0:25
Which depending on how we write them, may
cause some extra bloat in the CSS output.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up