Welcome to the Treehouse Community
Looking to learn something new?
With mixins and nulls, Why wouldn't you just delete the variable instead of giving it a null value?
The video explains if you don't assigned a value to a variable in a mixin, it will give you an error message. Then by assigning a unnecessary none value, it will assigned that for each instance. But why would you use null? Why not just delete the variable unless you specifically were trying to remove a border which, you could probably avoid by not assigning it a border in the first place?
Maybe i'm way off or missing something.
Samuel KleosFront End Web Development Techdegree Student 7,604 Points
The reason you don't delete the parameter is that you want to be able to pass border values as an argument for your mixin at some point, but perhaps not all the time.
In situations when you pass the argument 'none' for the parameter where you don't need it, you get a line of code that is not needed with a rule (or perhaps) multiple rules with a value of
We don't want that, so we give it a default value of
null. Which means if you don't pass an argument for it, you don't get an error, and the CSS that would normally have been generated as a result of that parameter won't be generated.
If you have a mixin that sometimes you want to add a border and sometimes you don't, being able to pass null allows you that option without having to write a mixin for every eventuality.
Hope that makes sense, good luck! :)