nuxt / icon

The <Icon> component, supporting Iconify, Emojis and custom components.

Home Page:https://stackblitz.com/edit/nuxt-icon-playground?file=app.vue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set the stroke-width?

Rednas83 opened this issue · comments

Tried:

  <Icon name="feather:home" color="green" size="20%" stroke-width="2" />
  <Icon name="feather:home" color="green" size="20%" stroke-width="2px" />
  <Icon name="feather:home" color="green" size="20%" :stroke-width="'2'" />
  <Icon name="feather:home" color="green" size="20%" :stroke-width="'2px'" />
  <Icon name="feather:home" color="green" size="20%" style="stroke-width: 2" ; />
  <Icon name="feather:home" color="green" size="20%" style="stroke-width: 2px" />

I am not sure this feature is supported though

Iconify doesn't support that: https://iconify.design/docs/icon-components/svg-framework/dimensions.html. And I am not even sure it's possible for Iconify to do that in a universal way - I think you might use a iconset that supports pre-defined storke variants.

Looking at the website it is supported for some icon sets actually
https://icon-sets.iconify.design/feather/home/
image

Perhaps it can be achieved with

import { appendCustomStyle } from 'iconify-icon';
appendCustomStyle('svg [stroke-width="2"] { stroke-width: 1.5; }');

More info at iconify/iconify#196