From 08e92b04fbec236d5fa564fe885b0598cf2a1fd5 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 16 May 2024 12:52:50 +0200 Subject: [PATCH] fix(NcIconSvgWrapper): Fix icon size variable being undefined Use CSS variable with `style` binding instead, as the `v-bind` generated an undefined CSS variable. (Yet for the next branch, Vue 3, it seems to work). Signed-off-by: Ferdinand Thiessen --- src/components/NcIconSvgWrapper/NcIconSvgWrapper.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/NcIconSvgWrapper/NcIconSvgWrapper.vue b/src/components/NcIconSvgWrapper/NcIconSvgWrapper.vue index c72a5ba23b..e4069209c2 100644 --- a/src/components/NcIconSvgWrapper/NcIconSvgWrapper.vue +++ b/src/components/NcIconSvgWrapper/NcIconSvgWrapper.vue @@ -206,6 +206,9 @@ export default { attributes() { return { class: ['icon-vue', { 'icon-vue--inline': this.inline }], + style: { + ' --icon-size': this.iconSize, + }, role: 'img', 'aria-hidden': !this.name ? true : undefined, 'aria-label': this.name || undefined, @@ -233,10 +236,10 @@ export default { &:deep(svg) { fill: currentColor; - width: v-bind('iconSize'); - height: v-bind('iconSize'); - max-width: v-bind('iconSize'); - max-height: v-bind('iconSize'); + width: var(--icon-size, 20px); + height: var(--icon-size, 20px); + max-width: var(--icon-size, 20px); + max-height: var(--icon-size, 20px); } }