I want to add borders determined by @media
breakpoints. My code is as follows:
@media(max-width:767px) { $height: auto; $grid: 1; }
@media(min-width: 768px) and (max-width:991px) { $height: 370px; $grid: 2; }
@media(min-width: 992px) and (max-width:1199px) { $height: 240px; $grid: 4; }
@media(min-width: 1200px) { $height: 195px; $grid: 6; }
article:nth-child(-n+#{$grid}) {
border-top: 1px solid #353535;
}
SASS returns error Undefined variable: "$grid"
. But I don't know why. What can I do?