KyleAMathews / react-spinkit

A collection of loading indicators animated with CSS for React
http://kyleamathews.github.io/react-spinkit/
MIT License
1.49k stars 73 forks source link

size change #63

Open iBasit opened 6 years ago

iBasit commented 6 years ago

How can we change the size to make it bigger?

Maybe few predefined sizes would be good (small, medium, large, x-large)?

fxfactorial commented 6 years ago

@iBasit this is simple CSS,

.sk-spinner {
  transform: scale(2);
}
chulanovskyi commented 6 years ago

@fxfactorial The "scale" wouldn't work, because it will lead to crucial loss of quality:

scale

@iBasit Instead, you could rewrite the spinner class, that you using, width and height attributes. In my app I'm using <Spinner name="circle"/> and have customized it with:

.sk-circle {
    width: 100px;
    height: 100px;

widthHeight

And, of course, you should wrap this customization with another class so it won't apply for the every spinner in your app

!UPDATES: Some types (like "ball-clip-rotate") may contain an additional wrapper, so they should to be overwritten like this:

.sk-circle > div {
    width: 100px;
    height: 100px;
flogy commented 3 years ago

In case you use styled components:

const LargeSpinner = styled(Spinner)`
  & > div {
    width: 140px;
    height: 140px;
  }
`