Apply default icon styles using Vue provide/inject
mainYou can apply a default style to all icons within a specific part of your component tree by using Vue's provide API. This allows you to set a consistent look (like color or weight) without passing props to every individual icon. Icons will use the nearest provider found above them in the tree.
Available keys for providing: color, size, weight, and mirrored.
<template>
<PhHorse /> {/* Uses provided styles: lime-green, 32px, bold */}
<PhHeart /> {/* Same as above */}
<PhCube /> {/* Same as above */}
</template>
<script lang="ts" setup>
import { PhHorse, PhHeart, PhCube } from "@phosphor-icons/vue";
import { provide } from "vue"
provide("color", "limegreen")
provide("size", 32)
provide("weight", "bold")
provide("mirrored", false)
</script>