Feature: generate static css icon
See original GitHub issueSometimes especially when working with non vue components one needs to have icons defined at css level e.g.
.my-icon-stats {
background: transparent url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgc3Ryb2tlPSIjN0Y4QzhEIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMC41IDZWNC41aC01di41MzJhMSAxIDAgMCAwIC4zNi43NjhsMS43MTggMS40MzJhMSAxIDAgMCAxIDAgMS41MzZMNS44NiAxMC4yYTEgMSAwIDAgMC0uMzYuNzY4di41MzJoNVYxMCIvPjxyZWN0IHg9IjEuNSIgeT0iMS41IiB3aWR0aD0iMTMiIGhlaWdodD0iMTMiIHJ4PSIyIi8+PC9nPjwvc3ZnPg==)
no-repeat center;
background-size: 16px 16px;
height: 16px;
opacity: 0.87;
width: 16px;
max-width: 16px;
display: inline-block;
}
then it can be used as <span class="my-icon-stats"></span>
even without Vue or other framework. This will not be useful for every framework combination but will also allow for this library to be used with no framework as well.
I guess this might be possible with unplugin-icons on demand via special command or syntax, especially since most of the svg extraction is done.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Custom icon in static website - css - Stack Overflow
I am new to this sort of thing so might be wrong but as I understand it I made the new icon as...
Read more >Icons Static Site Generator - Nicepage
Generate your own static website with the best free Static Website Generator of 2022. Use the biggest collection of 10000+ static web page...
Read more >Creating a Maintainable Icon System with Sass - CSS-Tricks
We can use that here to create one version of our icons in our Sass map, using a placeholder for our color values....
Read more >How To Animate Icons - W3Schools
Learn how to use icons to make an animated effect. ... A function called chargebattery() does all the replacing and displaying of icons....
Read more >Add Social Share Buttons to Your Static Site Without Tracking
In this article we're going to quickly build social share icons that ... site generator we're only going to be dealing with HTML,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
And here the code:
@husayt closing this since it has been included on unocss, if you want still this behavior open a new one issue.