Coding task · HTML and CSS course · Module 7: SASS
SASS Mixin with Parameters
Mixins with parameters let you create reusable code blocks with different values. Just as pharaoh's craftsmen created variations of ornaments from the same pattern, @mixin with parameters creates style variations.
Task
Create @mixin button-style($bg, $color) { background: $bg; color: $color; padding: 10px 20px; border: none; border-radius: 5px; }. Use it: .btn-primary { @include button-style(#2C3E50, white); }, .btn-secondary { @include button-style(#D4AF37, black); }. Add a $radius parameter with a default value!