Skip to content

Instantly share code, notes, and snippets.

@diegocuruma
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save diegocuruma/7fe041928004b1af095d to your computer and use it in GitHub Desktop.

Select an option

Save diegocuruma/7fe041928004b1af095d to your computer and use it in GitHub Desktop.
@each para background dinâmico
.page-quem-somos .cont:before {
content: "";
position: absolute;
width: 100%;
height: 250px;
background: url("../images/bg-interno.jpg") no-repeat;
background-position: left 0px;
}
.page-promocoes .cont:before {
content: "";
position: absolute;
width: 100%;
height: 250px;
background: url("../images/bg-interno.jpg") no-repeat;
background-position: left -250px;
}
.page-teste .cont:before {
content: "";
position: absolute;
width: 100%;
height: 250px;
background: url("../images/bg-interno.jpg") no-repeat;
background-position: left -500px;
}
.cont:before{
content: "";
position:absolute;
width:100%;
height:250px;
}
$lista: 'page-quem-somos', 'page-promocoes', 'page-teste';
$pos: 250 ;
@each $elemento in $lista {
$pos: $pos - 250;
.#{$elemento}{
.cont:before{
background: url('../images/bg-interno.jpg') no-repeat;
background-position:left $pos + px;
}
}
}

SPRIT SASS (SCSS) PARA PAGINAS INTERNAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment