본문 바로가기
css

변수를 sass로 정의하고 사용하는 방법

by code-box 2022. 2. 5.
반응형

$ 기호를 사용하여 변수 $variable_name: variable_value를 정의합니다. 아래에서는 Codever 프로젝트에 사용되는 _colors.scss 파일에서 무연탄-회색을 정의합니다. 그런 다음 클래스 정의에서 변수를 참조합니다.

$anthracite-gray: #4A5054;

.anthracite-gray {
    color: $anthracite-gray;
}

참조 -

https://sass-lang.com/documentation/variables

댓글