Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use styled-icons in a pseudo :before or :after element? #1988

Open
jmcannon opened this issue Mar 27, 2022 · 1 comment
Open

Comments

@jmcannon
Copy link

jmcannon commented Mar 27, 2022

For example, by getting direct access to the SVG path definition?

@jacobwgillespie
Copy link
Member

Hey, I'm not sure that this is possible, especially the ability to style embedded SVGs within a pseudo element. I think it's possible to embed SVGs in a :before or :after via something like content: url("data:image/svg+xml; utf8, <svg>...</svg>), but that's outside the scope of React really, you'd need just the raw SVG content.

If it's useful, all Styled Icons are generated from parallel packages under the @svg-icons package namespace, see https://www.npmjs.com/org/svg-icons. Each one of those packages has the same icons as the Styled Icons packages, but just as plain SVG files. You might be able to import those somehow and configure your bundler to return them as strings for embedding in CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants