인프런 커뮤니티 질문&답변
antd styled components 적용관련 질문드립니다!
해결된 질문
작성
·
321
0
const TitleStyled = styled(Title)`
text-align: center;
margin-bottom: 24px;
`;
이런식으로 스타일을 적용하려는데 CSS의 선택 우선순위때문에 스타일이 적용되지 않습니다.
좀알아 봤더니....
const TitleStyled = styled(Title)`
&& {
text-align: center;
margin-bottom: 24px;
}
`;
이런식으로 &을 여러번 사용해서 빌드된 클래스를 붙여서 선택 우선순위를 올리라고 되있더라구요...
!important 방법은 권하지않는다고 적혀있구요...
혹시 위 방법말고는 방법이 없나 여쭙니다..




