Skip to content

Commit

Permalink
fix: viewBox lost
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Oct 21, 2022
1 parent 6f099f5 commit 82f8e5a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 59 deletions.
21 changes: 11 additions & 10 deletions packages/solid-iconify/lib/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import type { JSX } from "solid-js";
import type { JSX } from "solid-js"

export interface IconTree {
a: JSX.SvgSVGAttributes<SVGSVGElement>;
c: string;
a: JSX.SvgSVGAttributes<SVGSVGElement>
c: string
}

export interface IconProps extends JSX.SvgSVGAttributes<SVGSVGElement> {
size?: string | number;
color?: string;
title?: string;
style?: JSX.CSSProperties;
size?: string | number
color?: string
title?: string
style?: JSX.CSSProperties
}

export interface IconBaseProps extends IconProps {
src: IconTree;
src: IconTree
}

export declare type IconTypes = (props: IconProps) => JSX.Element;
export declare type IconTypes = (props: IconProps) => JSX.Element

export function IconTemplate(iconSrc: IconTree, props: IconProps): JSX.Element {
return (
Expand All @@ -30,6 +30,7 @@ export function IconTemplate(iconSrc: IconTree, props: IconProps): JSX.Element {
color: props.color,
}}
{...iconSrc.a}
viewBox={iconSrc.a.viewBox}
{...props}
height={props.size || "1em"}
width={props.size || "1em"}
Expand All @@ -38,5 +39,5 @@ export function IconTemplate(iconSrc: IconTree, props: IconProps): JSX.Element {
>
{props.title && <title>{props.title}</title>}
</svg>
);
)
}
5 changes: 3 additions & 2 deletions packages/solid-iconify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@
"typescript": "^4.7.4",
"vite": "^3.0.9",
"vite-plugin-dts": "^1.4.1",
"vite-plugin-solid": "^2.3.0"
"vite-plugin-solid": "^2.3.10",
"solid-js": "^1.6.0"
},
"peerDependencies": {
"solid-js": "^1.4.8"
"solid-js": "^1.6.0"
}
}
71 changes: 26 additions & 45 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sites/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"typescript": "^4.7.4",
"unocss": "^0.45.30",
"vite": "^3.0.9",
"vite-plugin-solid": "^2.3.0"
"vite-plugin-solid": "^2.3.10"
},
"dependencies": {
"@iconify/types": "^2.0.0",
"@solidjs/router": "^0.5.0",
"@unocss/reset": "^0.45.30",
"iconify-icon": "^1.0.1",
"solid-iconify": "^0.0.3",
"solid-js": "^1.4.8"
"solid-js": "^1.6.0"
}
}

0 comments on commit 82f8e5a

Please sign in to comment.