Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3.1.0] @tabler/icons-vue lacks the default stroke-width #1067

Open
fisschl opened this issue Mar 18, 2024 · 1 comment · May be fixed by #1129
Open

[v3.1.0] @tabler/icons-vue lacks the default stroke-width #1067

fisschl opened this issue Mar 18, 2024 · 1 comment · May be fixed by #1129
Labels
bug Something isn't working

Comments

@fisschl
Copy link

fisschl commented Mar 18, 2024

If I don't pass stroke-width on the Vue component, in the createVueComponent function, the stroke-width option will be overwritten as undefined.

This causes the stroke-width option set in defaultAttributes.ts to not take effect.

import { h } from 'vue';
import defaultAttributes from './defaultAttributes';
import type { Icon, IconNode, IconProps } from './types';

const createVueComponent =
  (
    type: 'outline' | 'filled',
    iconName: string,
    iconNamePascal: string,
    iconNode: IconNode,
  ): Icon =>
  ({ size, color = 'currentColor', class: classes, stroke, ...rest }: IconProps, { attrs, slots }) => {
    return h(
      'svg',
      {
        ...defaultAttributes[type],
        width: size,
        height: size,
        ...attrs,
        class: ['tabler-icon', `tabler-icon-${iconName}`],
        ...(type === 'filled'
          ? {
              fill: color,
            }
          : {
              'stroke-width': stroke,
              stroke: color,
            }),
        ...rest,
      },
      [...iconNode.map((child) => h(...child)), ...(slots.default ? [slots.default()] : [])],
    );
  };

export default createVueComponent;
@fisschl fisschl changed the title @tabler/icons-vue lacks the default stroke-width [v3.1.0] @tabler/icons-vue lacks the default stroke-width Mar 18, 2024
@BG-Software-BG BG-Software-BG added the bug Something isn't working label Mar 19, 2024
C0Nd3Mnd pushed a commit to C0Nd3Mnd/tabler-icons that referenced this issue May 14, 2024
@andrey-hohlov
Copy link

andrey-hohlov commented May 22, 2024

Still actual in v3.5
This issue blocks for us upgrade from v2.

Also actual for size prop (should be 24 by default).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants