강의
47:34
@function weight($weight-name) {
@return map-get($font-weights , $weight-name )
}
@mixin box-default {
padding: 20px 30px;
margin-bottom: 20px;
}
@mixin mobile {
@media (max-width: $mobile) {
@content;
}
}
extend를 활용하면 같은 속성을 확장하는 것도 가능하다!
#{&}__paragraph1 {
font-weight:weight(regular);
&:hover {
color: pink;
}
}
#{&}__paragraph2 {
@extend .main__paragraph1;
&:hover {
color: $accent-color;
}
}
루프 구현
@for $i from 1 through 4 {
.menu-nav__item:nth-child(#{$i}) {
transition-delay: ($i * 0.1s) + 0.15s;
}
}
반복 grid-template-columns: repeat(2, 1fr); //1fr 1fr 2 time repeat