Skip to content

Commit

Permalink
feat: svg content on sever side
Browse files Browse the repository at this point in the history
  • Loading branch information
x64Bits committed Oct 16, 2022
1 parent b863ecc commit 415dbc4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { JSX } from "solid-js";
import { isServer } from "solid-js/web";

export interface IconTree {
a: JSX.SvgSVGAttributes<SVGSVGElement>;
Expand Down Expand Up @@ -27,7 +28,7 @@ export function IconTemplate(iconSrc: IconTree, props: IconProps): JSX.Element {
style={{
...props.style,
overflow: "visible",
color: props.color,
color: props.color || "currentColor",
}}
{...iconSrc.a}
{...props}
Expand All @@ -36,6 +37,7 @@ export function IconTemplate(iconSrc: IconTree, props: IconProps): JSX.Element {
innerHTML={iconSrc.c}
xmlns="http://www.w3.org/2000/svg"
>
{isServer && iconSrc.c}
{props.title && <title>{props.title}</title>}
</svg>
);
Expand Down

0 comments on commit 415dbc4

Please sign in to comment.