
{}생략;생략$base-font: 16px;
p
font-size: $base-font
line-height: 1.5
$base-font: 20px;
p {
font-size: $base-font;
line-height: 1.5;
}
Syntax를 가지고 있고 여기에 mixin, nesting selector, inheritance selector 등 프로그래밍적인 요소를 접목해 방대해지는 CSS 문서의 양을 효율적으로 처리하고 관리해주는 통합적이 단어Compiler를 통해 CSS 문서로 변한하여 사용해야 한다.$unit: 20px;
$gutter: 5px;
@for $i from i through 12 {
.col-#{$i} {
width: $i * ($unit + $gutter);
}
}
==, !=, >= ...)@if ($size == 24) {
@include text-style-24;
}
type-of 연산자 사용 가능@if (type-of($color) == color) {
color: $color;
}
and, or, not)@if ($type == fixed or $type == absolute) {
position: $type;
top: 50%;
transform: translateY(-50%);
}
Sass는 main.scss를 두고 각 파일들을 용도에맞게 분리하여 @import 하는 방식으로 사용
모듈로 분리해내서 사용하는 파일명들은 앞에
_를 붙여주자
_를 붙이면 import한 scss 파일에 대해 별도의 컴파일하지 않고 main.scss에서 한꺼번에 style.css로 컴파일됨