Top "Mixins" questions

A mixin is a way to enhance an object with properties or methods from another object without inheriting from that object.

What is a mixin, and why are they useful?

In "Programming Python", Mark Lutz mentions "mixins". I'm from a C/C++/C# background and I have not heard the …

python oop multiple-inheritance mixins
Syntax for if/else condition in SCSS mixin

Hi I'm trying to learn SASS/SCSS and am trying to refactor my own mixin for clearfix what I'd like …

conditional mixins sass if-statement
Sass - Converting Hex to RGBa for background opacity

I have the following Sass mixin, which is a half complete modification of an RGBa example: @mixin background-opacity($color, $opacity: .3) { …

css sass background-color mixins rgba
Ruby: module, require and include

I'm trying to use Ruby modules (mixins). I have test.rb: #!/usr/bin/env ruby require_relative 'lib/mymodule' class …

ruby module mixins
Inheriting class methods from modules / mixins in Ruby

It is known that in Ruby, class methods get inherited: class P def self.mm; puts 'abc' end end class …

ruby mixins
Mixing multiple traits in Scala

Quick note: Examples from the tutorial Scala for Java Refugees Part 5: Traits and Types. Suppose I have the traits Student, …

scala mixins traits
Doing math on variable argument Sass mixins

I like to use rem units with pixel fallbacks for my CSS sizing and am trying to make mixins to …

css sass mixins
What are Mixins (as a concept)

I'm trying to get my head around the Mixin concept but I can't seem to understand what it is. The …

c++ oop templates mixins
ruby inheritance vs mixins

In Ruby, since you can include multiple mixins but only extend one class, it seems like mixins would be preferred …

ruby class inheritance module mixins
Is it possible to implement mixins in C#?

I've heard that it's possible with extension methods, but I can't quite figure it out myself. I'd like to see …

c# extension-methods mixins