반응형
@function 예제 (1)
@function half-opacity($color) {
$color: rgba($color, .5);
@return $color;
}
h1 {
font-size: 10em;
text-align: center;
color: half-opacity(red);
}
@function 예제 (2)
@function half-opacity($color, $opacity) {
$color: rgba($color, $opacity);
@return $color;
}
h1 {
font-size: 10em;
text-align: center;
color: half-opacity(blue, 0.3);
}
참고 링크
Sass: Documentation
Sass is a stylesheet language that’s compiled to CSS. It allows you to use variables, nested rules, mixins, functions, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized and makes it easy to share design wi
sass-lang.com
Sass Tutorial
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
Sass - Basics | PoiemaWeb
Sass(Syntactically Awesome StyleSheets)는 CSS pre-processor로서 CSS의 한계와 단점을 보완하여 보다 가독성이 높고 코드의 재사용에 유리한 CSS를 생성하기 위한 CSS의 확장(extension)이다. CSS의 간결한 문법은 배
poiemaweb.com
반응형
'cs > html-css-basic' 카테고리의 다른 글
[HTML/CSS] 3-5. Sass @mixin (0) | 2022.03.12 |
---|---|
[HTML/CSS] 3-4. Sass Variables (0) | 2022.03.12 |
[HTML/CSS] 3-3. Sass @import (0) | 2022.03.12 |
[HTML/CSS] 3-2. Sass 7-1 패턴 (0) | 2022.03.12 |
[HTML/CSS] 3-1. Sass란? (0) | 2022.03.12 |