Skip to content

Instantly share code, notes, and snippets.

View rjfranco's full-sized avatar
🙂
Either working or playing video games

Ramiro Jr. Franco rjfranco

🙂
Either working or playing video games
View GitHub Profile
@rjfranco
rjfranco / pop-stripe.md
Created July 19, 2012 04:59
Rainbow stripe mixin with SCSS + Compass

Rainbow stripe mixin with SCSS + Compass

I'm trying to make a horizontal rainbow stripe background gradient mixin, but I feel like this is way too verbose. How can it be better?

Goals:

  1. Use variables for colors so they can be swapped out for different colors.
  2. The widths are hard coded for 8 colors. Can it be done smarter where it adjusts to the number of colors you add? Or is that asking too much?
  3. The colors are defined twice for the color starts and stops. Can this be done better?
  4. Right now I define the colors as variables at the top level, then pass them in the mixin. Should they instead be created inside the mixin and then colors are brought in as arguments? Or does that matter?