Created
January 20, 2023 13:44
-
-
Save ZeldOcarina/db2d9b1934825bb1a4166f41e83169a3 to your computer and use it in GitHub Desktop.
How to create a custom marker for an li with React Icons and Styled Components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
styled.li` | |
&::marker { | |
color: var(--black); | |
// Use as a list symbol a React Icons icon | |
content: ${() => { | |
return css` | |
url("data:image/svg+xml;charset=UTF-8,${ReactDOMServer.renderToString( | |
<IoChevronForwardCircleOutline /> | |
).replaceAll('"', "'")}") | |
` | |
} | |
}; | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment