Created
February 19, 2015 19:01
-
-
Save Kcko/e3adfbfbf924edb78c4c to your computer and use it in GitHub Desktop.
Generování cyklů z pole / lists
This file contains 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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
/*! 1 zpusob pres lists a funkci nth */ | |
$flash_types: (success #d4ffd4), (error #ffd5d1); | |
@each $flash_def in $flash_types { | |
$type: nth($flash_def, 1); | |
$colour: nth($flash_def, 2); | |
.#{$type} { | |
background-image: url(../images/#{$type}.png); | |
} | |
} | |
/* 2 zpusob pomoci tzv. multiple assignment */ | |
$animals: (puma, black, default), | |
(sea-slug, blue, pointer), | |
(egret, white, move); | |
@each $animal, $color, $cursor in $animals { | |
.#{$animal}-icon { | |
background-image: url('/images/#{$animal}.png'); | |
} | |
} | |
This file contains 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
/*! 1 zpusob pres lists a funkci nth */ | |
.success { | |
background-image: url(../images/success.png); | |
} | |
.error { | |
background-image: url(../images/error.png); | |
} | |
/* 2 zpusob pomoci tzv. multiple assignment */ | |
.puma-icon { | |
background-image: url("/images/puma.png"); | |
} | |
.sea-slug-icon { | |
background-image: url("/images/sea-slug.png"); | |
} | |
.egret-icon { | |
background-image: url("/images/egret.png"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment