Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialloriortiz2
1,166 Pointsmixin vs placeholder
I don't understand the use case for a placeholder instead of a mixin
4 Answers
Naomi Freeman
Treehouse Guest TeacherAs far as I understand, placeholder text is just light grey text inside an input field that disappears when a user clicks in the input field.
A mixin creates a breakpoint where your media will split when on different screen sizes.
Or do you mean Sass placeholders?
Having written this, I assume you mean the latter now. Mixins let you have variables. Placeholders don't. This means placeholders won't let you do context specific things the way a mixin would.
Also, so far as I understand, placeholders won't duplicate themselves since they don't compile (this is a good thing).
So there's good and bad to each.
I say this having not watched the video you come from, because the internet here is slow.
loriortiz2
1,166 PointsA placeholder is just an extended class, a class that isn't used except to extend in various classes..and why do you say they can't have variables?
loriortiz2
1,166 PointsGood article...thanks for pointing that out. Explains it well.