728x90

1. 변수 정의하기
Sass에서 변수를 정의하려면 $ 기호로 시작되며, 예를 들어 색상이나 폰트 크기 등을 변수로 정의할 수 있습니다.
$primary-color: #3498db;
$font-size: 16px;
2. 변수 사용하기
정의한 변수를 CSS 속성에 사용할 수 있습니다.
body {
color: $primary-color;
font-size: $font-size;
}
3.변수 재사용
변수를 재사용하여 코드의 일관성을 유지하고 유지보수를 쉽게 할수 있습니다.
$padding: 10px;
.box {
padding: $padding;
}
button {
padding: $padding;
}
GitHub - Koras02/sass-bloging: https://thinky.tistory.com/category/Front-End/SASS
https://thinky.tistory.com/category/Front-End/SASS - Koras02/sass-bloging
github.com
728x90
LIST
'Front-End > SASS' 카테고리의 다른 글
[Sass] 5장 상속(Inheritance) 사용법 (0) | 2025.09.03 |
---|---|
[Sass] 4장 믹스인(Mixin) 생성 및 사용 (0) | 2025.08.07 |
[Sass] 3장 Nesting (0) | 2025.03.27 |
[Sass] 1장 Sass란? (0) | 2025.03.09 |