diff --git a/README.md b/README.md index f72a656c..e5280bd9 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Access thousands of icons as components **on-demand** universally. - ๐คน **Any** icon sets - 100+ popular sets with over 10,000 icons, logos, emojis, etc. Powered by [Iconify](https://github.com/iconify/iconify). - ๐ฆ **Major** build tools - Vite, Webpack, Rollup, Nuxt, etc. Powered by [unplugin](https://github.com/unjs/unplugin). - ๐ช **Major** frameworks - Vanilla, Web Components, React, Vue 3, Vue 2, Solid, Svelte, and more. [Contribute](./src/core/compiles). + - ๐๏ธ **CSS** icons - Use icons as css stylesheets with or without any framework (experimental). - ๐ฑ **Any** combinations of them! - โ๏ธ On-demand - Only bundle the icons you really use, while having all the options. - ๐จ SSR / SSG friendly - Ship the icons with your page, no more FOUC. @@ -650,6 +651,23 @@ IconsResolver({ ``` +### CSS Icons + +You can use svg icons as a `css stylesheet` (no framework required): +```ts +import '~icons/{collection}/{icon}.css' +``` + +then add an `html` element with a `class` with a name following the convention: `{collection}-{icon}`. + +For example: +```html + + +``` + ### Collection Aliases When using component resolver, you have to use the name of the collection that can be long or redundant: for example, diff --git a/examples/sveltekit/src/routes/index.svelte b/examples/sveltekit/src/routes/index.svelte index 3c390674..292bc088 100644 --- a/examples/sveltekit/src/routes/index.svelte +++ b/examples/sveltekit/src/routes/index.svelte @@ -1,4 +1,5 @@ + + diff --git a/examples/vite-web-components/index.html b/examples/vite-web-components/index.html index 75b9b4f7..2b7c63eb 100644 --- a/examples/vite-web-components/index.html +++ b/examples/vite-web-components/index.html @@ -6,10 +6,12 @@