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 trial

CSS

Refactor this. The function as well as the multiple parameters aren't needed.

This is a lot quicker and a direct way of writing the same code shown in the video

@mixin random-color($attr){
  #{$attr}: rgba(random(255),random(255),random(255), random()*1);
}

.random-color{
 @include random-color(background-color);
}
Steven Parker
Steven Parker
231,110 Points

Which video are you referring to?

Steven Parker it was suppose to go under "Using Random functions in your Designs"

Steven Parker
Steven Parker
231,110 Points

I was hoping you might provide a link to the actual video. :wink: