&
- & : active - ButtonL1이 활성화되면 {}를 적용시켜라!
- "&"를 사용하면 현재 스타일드 컴포넌트의 자기 자신을 나타
- 활성화 상태: onClick을 예로 들면 클릭해서 떼는 시점까지를 말함
const ButtonL1 = styled.button`
width: 200px;
height: 50px;
margin: 5px 5px;
border-radius: 5px;
border: 3px solid green;
background-color: white;
font-weight: 700;
cursor: pointer;
// 내용물 정렬
display: flex;
flex-direction : row;
justify-content: center;
align-items: center;
&:active {
background-color: #e3e3e3;
}
`
참고
LESS Parent Selector(&)
LESS 부모 선택자 이 글에서는 LESS 문법 중 부모(상위) 선택자에 대해 알아보는 시간을 가져보겠습니다. LESS Parent Selectors documentation Parent Selectors LESS 에서 부모 선택자를 참조하기위해 & 지시자를
webclub.tistory.com
'⛵ 항해99 > TIL · WIL ✏️' 카테고리의 다른 글
[TIL] 2023.09.08 - Event.stopPropagation() (0) | 2023.09.08 |
---|---|
[TIL] 2023.09.07 - overflow: hidden 부분 적용 방법(position: fixed) (0) | 2023.09.07 |
[TIL] 2023.09.05 - 리액트 아이콘(react-icons) 사용하기 (0) | 2023.09.05 |
[TIL] 2023.09.04 - <Header /> 와 <Header></Header> (0) | 2023.09.05 |
[WIL] 08.28 ~ 09.03 (0) | 2023.09.03 |