Skip to content

Instantly share code, notes, and snippets.

@finteractive
Last active August 29, 2015 14:28
Show Gist options
  • Save finteractive/1c251428b9943d905fa4 to your computer and use it in GitHub Desktop.
Save finteractive/1c251428b9943d905fa4 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="icon--checkmark"></div>
<div class="icon--plus"></div>
<div class="icon--minus"></div>
// ----
// libsass (v3.2.5)
// ----
/*
Source: http://webdesign.tutsplus.com/tutorials/an-introduction-to-sass-maps-usage-and-examples--cms-22184
Topic: An Introduction to Sass Maps: Usage
*/
/* 1. Loop Through a Map and Generate Classes */
/* Define the Sassy Map called $icons */
$icons: (
checkmark: "\2713",
plus: "+",
minus: "-"
);
/* For each key in the map, created an own class */
@each $name, $value in $icons {
.icon--#{$name} {
&:after{
content: $value;
}
}
}
@charset "UTF-8";
/*
Source: http://webdesign.tutsplus.com/tutorials/an-introduction-to-sass-maps-usage-and-examples--cms-22184
Topic: An Introduction to Sass Maps: Usage
*/
/* 1. Loop Through a Map and Generate Classes */
/* Define the Sassy Map called $icons */
/* For each key in the map, created an own class */
.icon--checkmark:after {
content: "✓";
}
.icon--plus:after {
content: "+";
}
.icon--minus:after {
content: "-";
}
<div class="icon--checkmark"></div>
<div class="icon--plus"></div>
<div class="icon--minus"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment