css
will-change, Focus-inside, transition
FluanceiFi
2022. 9. 29. 19:37
๐ Will-change
๊ธฐ๋ณธ์ ์ผ๋ก ๋ธ๋ผ์ฐ์ ์๊ฒ "๋ญ๊ฐ ๋ฐ๋ ๊ฒ ์ด๋ค" ๋งํด์ค๋ค.
๋ธ๋ผ์ฐ์ ๋ ์ ๋๋ฉ์ด์ ์ ๋ ๋์์ง๊ฒ ํ๋ค. (๋ธ๋ผ์ฐ์ ์๊ฒ ๋ ๋๋ง ํํธ๋ฅผ ์ค๋ค.)
Element์ ์คํ๋๊ธธ ๊ธฐ๋ํ๋ ๋ณํ๋ฅผ ๋ช ์ํจ.
Will-change๋ ๊ทธ๋ํฝ์นด๋๋ฅผ ์ด์ฉํด์ ์ ๋๋ฉ์ด์ ์ ๊ฐ์ํํ๋ค
๐ Focus-inside
๋ด๋ถ์ ์ผ๋ก focus๋ element๊ฐ ์๋์ง ์ ์ ์๋๋ก ํด์ค๋ค.
Ex) rely:focus-within
reply ๋ด๋ถ์ ์ด๋ค element๊ฐ focus๋์ด ์๋ค๋ฉด ์ด๋ผ๋ ๋ป
.reply:focus-within .reply__column:first-child {
display: none;
}โ
์ค๋ช : reply ์์ reply__column:first-child ๊ฐ ์๋ค๋ฉด display๋ none์ด ๋๋ค๋ ๋ป
๐ Transition
transition: all
์ ์ฉํ element์ ์์ฑํ๋ฉด ๋ถ๋๋ฝ๊ณ ์์ฐ์ค๋ฝ๊ฒ ํ๋ํ๋ค..