phosphor-icons / react

A flexible icon family for React
https://phosphoricons.com
MIT License
1.1k stars 57 forks source link

SSR Components missing default size="1em" #69

Closed theo-staizen closed 11 months ago

theo-staizen commented 1 year ago

TL;DR: I believe the following line of code should change from size, to size = "1em", https://github.com/phosphor-icons/react/blob/master/src/lib/SSRBase.tsx#L12


A very common pattern is that we have, is that we want our icons to follow the text font size, which works great for client components, since their width/height defaults to 1em. For example (using tailwind classes)

<a className="text-2xl" href="/docs">
  <ArrowRight />
  Go to Documentation
</a>

This does not work as expected for SSR components, because by default, they do not have width/height set to 1em.

I understand that the components fom dist/ssr are not using React Context, but we should still have the same sensible defaults even for SSR (something that we have for color and weight), but just not be able to change them, because we cant use context.