# parent.scss
$parent-height: 100px;

# child.scss
@import "./parent";
.card{
    height: calc(100vh - #{$parent-height});
    width : $parent-height;
}

scss 의 변수 문법 사용해서 다른 파일에서 해당 변수를 불러올 수 있다.

일반적으로는 불러온 변수를 달러표시해서 그대로 사용하면되지만,

calc등 css함수를 사용할때는 #{} 안에 넣어줘야 정상적으로 읽힌다

 

+ Recent posts