Created
November 6, 2015 11:18
-
-
Save Vlasterx/b86c5c2c3ffa6f1ac4fa to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
// Setting object | |
$resolutions : ( | |
mobile: ( | |
name: mobile, | |
shortcut: m, | |
width: 320px | |
), | |
tablet: ( | |
name: tablet, | |
shortcut: t, | |
width: 800px | |
) | |
); | |
// Looping through all variables | |
@each $i in $resolutions { | |
// First we take name of sub-object | |
$res_name: (nth($i, 1)); | |
// Then we load object variables | |
$dev: map-get($resolutions, $res_name); | |
.loop-#{$res_name} { | |
width: map_get($dev, width); | |
} | |
} | |
// Calling one variable without looping | |
$dev: map-get($resolutions, mobile); | |
.single-#{map_get($dev, name)} { | |
width: map-get($dev, width); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.loop-mobile { | |
width: 320px; | |
} | |
.loop-tablet { | |
width: 800px; | |
} | |
.single-mobile { | |
width: 320px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment