CSS Selector / :where(), :is()
:where()
:where()
์ฌ์ฉ๋ฒ1
button:focus,
button:hover,
button:active {
background: blue;
}
/* ์๋์ ๊ฐ์ด ๊ฐ๊ฒฐํ๊ฒ ์์ฑ ๊ฐ๋ฅ */
button:where(:focus, :hover, :active) {
background: blue;
}
์ฌ์ฉ๋ฒ2
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
appearance: none;
cursor: pointer;
margin: 0;
border: none;
border-radius: 1em;
padding: 0.5em 1em;
color: white;
font-weight: bold;
background: royalblue;
}
/* ์๋์ ๊ฐ์ด ์ฌ๋ฌ ์์์ ๋์ผํ ์คํ์ผ ์ ์ฉ ๊ฐ๋ฅ */
:where(button, input[type="button"], input[type="reset"], input[type="submit"]) {
appearance: none;
cursor: pointer;
margin: 0;
border: none;
border-radius: 1em;
padding: 0.5em 1em;
color: white;
font-weight: bold;
background: royalblue;
}
์ฌ์ฉ๋ฒ3
button:focus,
button:hover,
button:active,
input[type="button"]:focus,
input[type="button"]:hover,
input[type="button"]:active,
input[type="reset"]:focus,
input[type="reset"]:hover,
input[type="reset"]:active,
input[type="submit"]:focus,
input[type="submit"]:hover,
input[type="submit"]:active {
background: blue;
}
/* ํ์ํ ์ ํ์๋ฅผ ๋ง์ด ์ค์ผ ์ ์๋ค. */
:where(button, input[type="button"], input[type="reset"], input[type="submit"]):where(:focus, :hover, :active) {
background: blue;
}
:is()
์ฐจ์ด์
:is()
์ฐจ์ด์ :where()
ํจ์๋ CSS ๋ช
์๋๊ฐ 0์ด๋ผ์, **:where()
์ด ์ฌ์ฉ๋ CSS ๊ท์น์ ๋ค๋ฅธ ์ ํ์๋ฅผ ํตํด์ ๋ฎ์ด์ฐ๊ธฐ๊ฐ ์ฉ์ดํ๋ค.**
:is()
๋ CSS ๋ช
์๋๋ ์ธ์๋ก ๋์ด์จ ์ ํ์ ์ค์์ ๊ฐ์ฅ ๋ช
์๋๊ฐ ํฐ ๊ฒ์ด ๋๊ธฐ ๋๋ฌธ์ ๋ค๋ฅธ ์ ํ์๋ก ๋ฎ์ด์ฐ๊ธฐ๋ฅผ ๋ฐฉ์งํ๊ณ ์ ํ ๋ ๋ ์ ํฉ
Last updated