@each ๋ฅผ ์ฌ์ฉํ์ฌ ๋ชฉ๋ก์ ํญ๋ชฉ์ ๋งคํ
https://beta.freecodecamp.org/en/challenges/sass/use-each-to-map-over-items-in-a-list
๋ด ์ฝ๋๊ฐ ๋ช
ํํ๊ฒ ์๋ํ๊ณ ๋ฏธ๋ฆฌ๋ณด๊ธฐ ์น์
์์ ์ฌ๋ฐ๋ฅธ ๊ฒฐ๊ณผ๋ฅผ ์ ๊ณตํ์ง๋ง ์ด๋ค ์ด์ ๋ก ๋
๋ด๊ฐ ๋์ ์ ํต๊ณผํ์ง ๋ชปํ๋ค๋ ๊ฒ์ ์ดํดํ์ญ์์ค.
<style type='text/sass'>
<strong i="27">@each</strong> $color in blue, black, red {
.#{$color}-bg {background-color: $color}
}
div {
height: 200px;
width: 200px;
}
</style>
<div class="blue-bg"></div>
<div class="black-bg"></div>
<div class="red-bg"></div>
์์ค๋ฅผ ๋ณด๋ฉด ํ
์คํธ์ ํด๋์ค ์ ํ๊ธฐ์ ํ์ํ .
๊ฐ ๋๋ฝ ๋ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค.
blue-bg
ํ๊ณ ์์ผ๋ฉฐ .blue-bg
์ด์ด์ผํฉ๋๋ค.
"assert ($ ( 'blue-bg'). css ( 'background-color') == 'rgb (0, 0, 255)', 'message : .blue-bg
ํด๋์ค์๋ background-color
๊ฐ ์์ด์ผํฉ๋๋ค. ํ๋์์
์ด๊ฒ์ 318-320 ํ์
๋๋ค.
freeCodeCamp / seed / challenges / 03-front-end-libraries / sass.json
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ฌ๋์ด ์๋์ง ์๊ณ ์์ต๋๊น?
ํธ์ ๋ด์ ๊ฐ๊ธฐ ํ
์คํธ ์์ ์ ๊ด์ฌ์ด ์์ต๋๊น?
์ฐธ๊ณ ํด์ผ ํ Contributing Guide ์ ๋์์ด ํ์ํ ๊ฒฝ์ฐ Contributors ์ฑํ
๋ฐฉ์ด ์์ต๋๋ค .
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์์ค๋ฅผ ๋ณด๋ฉด ํ ์คํธ์ ํด๋์ค ์ ํ๊ธฐ์ ํ์ํ
.
๊ฐ ๋๋ฝ ๋ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.blue-bg
ํ๊ณ ์์ผ๋ฉฐ.blue-bg
์ด์ด์ผํฉ๋๋ค."assert ($ ( 'blue-bg'). css ( 'background-color') == 'rgb (0, 0, 255)', 'message :
.blue-bg
ํด๋์ค์๋background-color
๊ฐ ์์ด์ผํฉ๋๋ค. ํ๋์์์ด๊ฒ์ 318-320 ํ์ ๋๋ค.
freeCodeCamp / seed / challenges / 03-front-end-libraries / sass.json