Skip to content

Commit

Permalink
feat: add hover variant props to PhosphorIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Sep 4, 2024
1 parent a40cf9f commit 185f3c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/components/PhosphorIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ const props = defineProps({
required: false,
default: null
},
hoverVariant: {
type: String,
required: false,
default: null
},
fill: {
type: Boolean,
required: false,
Expand Down Expand Up @@ -181,6 +186,9 @@ const weight = computed(() => {
})
const color = computed(() => {
if (currentHover.value && props.hoverVariant) {
return `var(--bs-${props.hoverVariant}, var(--bs-${props.variant}, currentColor))`
}
return `var(--bs-${props.variant}, currentColor)`
})
Expand Down
10 changes: 10 additions & 0 deletions stories/murmur/components/PhosphorIcon.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ export const HoverWeight = {
}
}

export const HoverVariant = {
args: {
name: 'trash',
variant: 'link',
hoverVariant: 'danger',
hoverWeight: 'duotone',
size: '2xl'
}
}

export const WithText = {
args: {
name: 'globe',
Expand Down

0 comments on commit 185f3c8

Please sign in to comment.