Skip to content

Commit

Permalink
fix #100: change link icon class to use unocss (#108)
Browse files Browse the repository at this point in the history
Allows to have the link icons in the articles as css icons generated at
compile time, like the other icons on the site, instead of importing
them from fontawesome at runtime
  • Loading branch information
c-leri authored Jun 9, 2024
1 parent 7e48cb6 commit a7da8b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
export let data;
</script>

<!-- Needed to tell unocss that the link icon is indeed used -->
<div class="i-fa6-solid-link is-hidden" />

<HtmlHead />

<input id="low-contrast" type="checkbox" class="is-hidden" />
Expand Down
4 changes: 2 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ export default {
content: {
type: "element",
tagName: "span",
properties: { className: "icon header-anchor-container pl-3" },
properties: { className: "header-anchor-container pl-2" },
children: [
{
type: "element",
tagName: "i",
properties: {
className: "header-anchor fas fa-lg fa-link has-text-link is-size-5"
className: "header-anchor icon i-fa6-solid-link has-text-link is-size-5"
}
}
]
Expand Down
6 changes: 1 addition & 5 deletions uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { defineConfig, presetIcons } from "unocss";
export default defineConfig({
presets: [
presetIcons({
collections: {
"fa6-solid": () => import("@iconify-json/fa6-solid/icons.json").then((i) => i.default),
"fa6-brands": () => import("@iconify-json/fa6-brands/icons.json").then((i) => i.default),
tabler: () => import("@iconify-json/tabler/icons.json").then((i) => i.default)
},
// Collections are automatically imported from inconify packages
customizations: {
iconCustomizer(collection, icon, props) {
// Makes the empty cut in half circle slightly larger
Expand Down

1 comment on commit a7da8b5

@Cozy-GitHub
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See preview on Cloudflare Pages: https://8cc77226.developer-wiki.pages.dev

Please sign in to comment.