Skip to content

Instantly share code, notes, and snippets.

@bruno2ms
Last active February 27, 2018 14:00
Show Gist options
  • Save bruno2ms/57b0588740eee669b06eb001c937bfa6 to your computer and use it in GitHub Desktop.
Save bruno2ms/57b0588740eee669b06eb001c937bfa6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
> 0,01%
last 5 versions
// ----
// Sass (v4.0.0.alpha.1)
// Compass (vundefined)
// ----
// Var definition no Geral
$props:();
$props: map-merge($props, (main-menu__menu-home__span--props: (
color: blue,
background: #CCC
)));
$props: map-merge($props, (main-menu__menu-home__div--props: (
color: blue,
background: #CCC
)));
// Var definition no Cliente
$props: map-merge($props, (main-menu__menu-home__div--props: (
color: red,
border-radius: 4px
)));
@mixin extend-props($elem) {
$elem-props: map-get($props, $elem);
@each $key, $value in $elem-props {
#{$key}: $value;
}
}
.main-menu {
&__menu-home {
span {
@include extend-props(main-menu__menu-home__span--props);
}
div {
// Variavel sobrescrita no arquivo de variaveis do cliente
@include extend-props(main-menu__menu-home__div--props);
}
p {
// Variável inexistente, não deve quebrar o css
@include extend-props(main-menu__menu-home__p--props);
}
}
}
.main-menu__menu-home span {
color: blue;
background: #CCC;
}
.main-menu__menu-home div {
color: red;
border-radius: 4px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment