//@mixin은 해당 정보를 묶어놓는 모음집
//function은 기존 자바스크립트와 더 유사하게
//사용, 연산기능
@mixin center{
display:flex;
justify:center;
}
@function ratio($size, $ratio){
@return $size * $ratio
}
.box{
$width:160px;
width:$width;
height:ratio($width, 9/16);
@include center;
}
'프론트엔드 공부 > scss' 카테고리의 다른 글
scss @import 파일가져오기 / css > scss 변경(parcel bundler)과 url 리팩토링 (0) | 2021.05.28 |
---|---|
scss 컬러내장함수 (0) | 2021.05.28 |
scss 반복문(for $i from 1 from n){} (0) | 2021.05.28 |
scss @mixin의 재활용(초깃값 설정과 키워드인수설정) / @content 추가기능 (0) | 2021.05.28 |
scss 산술연산자 (0) | 2021.05.28 |