Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- API 토큰
- getModifierState
- CSS
- icon
- API token
- styled components
- Git
- git lab
- bootstrap
- nextjs .env
- next.js css
- input type=file
- fetch
- createGlobalStyle
- typescript react
- nextjs
- react typescript
- ngrok설치
- nextjs 설치
- github io
- There isn’t anything to compare
- 컨디셔널 렌더링
- ngrok실행
- react env
- SCSS
- npm styled-reset
- rewrites
- github
- dart 변수
- react
Archives
- Today
- Total
꾸준히 성장하는 개발자
SCSS 데이터 종류 본문
SCSS에도 데이터 종류가 있다
$number: 1; //.5, 100px, 1em
$string: bold; //relative, "../images/a.png"
$color: red; //blue, #FFF00, rgba(0,0,0,.1)
$boolean: true; //false
$null: null;
$list: orange, royalblue, yellow;
//list데이터 : js의 배열데이터와 유사하다
$map: (
o:orange,
r:royalblue,
y:yellow
);
//map데이터: js의 객체데이터와 비슷하다. 괄호는 소괄호를 사용한다.
.box{
width:100px;
color:red;
position: relative;
}
다른 데이터 종류와 다르게 색상데이터가 있다.
red나 blue처럼 작성하면 색상이 나오는것도 string데이터가 아닌 color데이터이다.
list데이터 활용예시
$list: orange, royalblue, yellow;
@each $c in $list {
.box{
color:$c;
}
}
map데이터 활용예시
$map: (
o:orange,
r:royalblue,
y:yellow
);
@each $k, $v in $map {
.box-#{$k}{
color:$v;
}
}
'CSS > SCSS' 카테고리의 다른 글
SCSS 색상 내장함수 (0) | 2022.03.29 |
---|---|
SCSS - 함수 (0) | 2022.03.29 |
SCSS 반복문 (0) | 2022.03.29 |
SCSS - 재활용(Mixins) (0) | 2022.03.25 |
SCSS 산술 연산 (0) | 2022.03.25 |