-
-
Save jackmcmorrow/6012115 to your computer and use it in GitHub Desktop.
Faz 'tipo' uma hash no Sass, proporção de uma pra uma (1:1); Agradecimentos ao @nathos pelo bizu sensacional.
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
@mixin categoria-cores { | |
@each $categoria in $categorias { | |
.cat-#{nth($category, 1)} { | |
background-color: nth($category, 2); | |
} | |
} | |
} |
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
// Categorias e a cor da categoria | |
// Isso é uma lista de listas, uma separada por vírgulas e a outra por espaços! | |
$categorias: site teal, juventude orange, poesia plum, ficcao salmon, escrita steelblue; | |
// O seletor placeholder que a gente ai extender -- placeholder selectors precisam de Sass 3.2 | |
%category-colors { | |
@include category-colors | |
} | |
.category-banners { | |
li { | |
// @extend nos itens da lista. | |
@extend %category-colors; | |
} | |
} |
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
/* Note that the placeholder class isn't output in the CSS */ | |
.category-banners li .cat-site { | |
background-color: teal; | |
} | |
.category-banners li .cat-juventude { | |
background-color: orange; | |
} | |
.category-banners li .cat-poesia { | |
background-color: plum; | |
} | |
.category-banners li .cat-ficcao { | |
background-color: salmon; | |
} | |
.category-banners li .cat-escrita { | |
background-color: steelblue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment