From 415dbc491a302a02bc66c63c21fce9cbe9d90543 Mon Sep 17 00:00:00 2001 From: Ignacio Zsabo Date: Sun, 16 Oct 2022 16:27:50 -0400 Subject: [PATCH] feat: svg content on sever side --- src/lib/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/index.tsx b/src/lib/index.tsx index d90d68b..eac62bc 100644 --- a/src/lib/index.tsx +++ b/src/lib/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "solid-js"; +import { isServer } from "solid-js/web"; export interface IconTree { a: JSX.SvgSVGAttributes; @@ -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} @@ -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 && {props.title}} );