davidhu2000 / react-spinners

A collection of loading spinner components for react
https://www.davidhu.io/react-spinners
MIT License
3.12k stars 269 forks source link

Font-size 0 breaks em CSS unit sizing for Pacman loader #571

Open sdemjanenko opened 1 year ago

sdemjanenko commented 1 year ago

Package Version 0.13.8

I'm trying to size the PacmanLoader using CSS units of em. When I do this, I observe the spinner has no height because font-size is set to 0. This is coming from

const wrapper: React.CSSProperties = {
    display: "inherit",
    position: "relative",
    fontSize: 0,
    height: `${value * 2}${unit}`,
    width: `${value * 2}${unit}`,
    ...cssOverride,
  };

I am planning on using cssOverride, but it would be nice if the library automatically detected the em units and didn't set font-size of 0 in that case.

This is the CSS that I observe on the span that contains the spinner

image

I also haven't checked if other loaders suffer from the same issue.