Skip to content

Instantly share code, notes, and snippets.

@hilja
Last active August 22, 2016 21:22
Show Gist options
  • Save hilja/65ea433e0f6dd3a36e1c to your computer and use it in GitHub Desktop.
Save hilja/65ea433e0f6dd3a36e1c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$primary-colors: (
"red": "#ff0000",
"green": "#00ff00",
"blue": "#0000ff"
);
/* Key and value together */
@each $color in $primary-colors {
.thing {
content: "#{$color}";
}
}
/* Key and value separate */
@each $color-name, $color-code in $primary-colors {
.color-#{$color-name} {
background: $color-code;
}
}
/* Key and value together */
.thing {
content: "red #ff0000";
}
.thing {
content: "green #00ff00";
}
.thing {
content: "blue #0000ff";
}
/* Key and value separate */
.color-red {
background: "#ff0000";
}
.color-green {
background: "#00ff00";
}
.color-blue {
background: "#0000ff";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment