-
[CSS] SVG path의 currentColor 키워드CSS 2023. 4. 13. 17:24
CSS의 currentColor 키워드는 현재 color 속성 값을 그대로 상속받는 키워드이다.
다크모드를 구현할 때 svg를 사용하였는데 path fill 속성에다 모드가 바뀔 때마다 color 값을 주고 싶었다.
이때 currentColor 값을 사용하면 현재 color 값을 상속받아 다크모드를 구현할 수 있었다.
<svg> <path fill="currentColor" ... /> </svg>
반응형'CSS' 카테고리의 다른 글
[CSS] 가변 폰트(Variable fonts)란? (0) 2023.08.14 [CSS] color-scheme, prefers-color-scheme 속성 (0) 2023.07.10 [CSS] 창 축소 시 요소 짤림 해결 (0) 2023.03.13 [CSS] 이미지 Layout Shift 방지 (0) 2022.10.26 [CSS] flex: 1이란 (0) 2022.09.14