arguments
-
Sass(SCSS) At-Rules #3[@function]CSS Preproseccor/Sass 2019. 4. 29. 15:50
함수(function) 함수를 사용하면 스타일시트 전체에서 재사용할 수 있는 SassScript 값에 대한 복잡한 연산을 정의할 수 있습니다. function 구문 @function (){...} 함수(function)은 유니버셜 명령문 뿐만 아니라 함수 호출의 결과로 사용할 값을 나타내는 return문도 포함할 수 있습니다. 함수는 일반적인 CSS 함수 구문을 사용하여 호출합니다. Scss // 함수 정의 @function pow($base, $exponent) { $result: 1; @for $_ from 1 through $exponent { $result: $result * $base; } @return $result; } .sidebar { float: left; // 함수 호출 margin-..
-
Sass(SCSS) At-Rules #2[@mixin & @includes]CSS Preproseccor/Sass 2019. 4. 29. 13:10
Mixin Mixins을 사용하면 스타일시트 전체에서 재사용할 수 있는 스타일을 정의할 수 있습니다. mixins 문법 // mixin 정의 @mixin (){...} // include @include @include () Scss @mixin reset-list { margin: 0; padding: 0; list-style: none; } @mixin horizontal-list { @include reset-list; li { display: inline-block; margin: { left: -2px; right: 2em; } } } nav ul { @include horizontal-list; } CSS nav ul { margin: 0; padding: 0; list-style: none;..