Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help wanted! - support size property #1

Open
JoshK2 opened this issue Sep 10, 2019 · 5 comments
Open

Help wanted! - support size property #1

JoshK2 opened this issue Sep 10, 2019 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@JoshK2
Copy link
Owner

JoshK2 commented Sep 10, 2019

Hey, I want to add support to size property like I started to do in the react project
https://github.com/joshK2/react-spinners-css#-list-of-spinners---proptypes-and-default-props

If someone wants to help me, it's with pleasure.

@JoshK2 JoshK2 added the help wanted Extra attention is needed label Sep 10, 2019
@exia
Copy link

exia commented Sep 12, 2019

@JoshK2 I'll get on this!

Just too clarify, you want a [size]="'64'" or size="64" which would be converted to 64px ?

Please assign to me.

@JoshK2
Copy link
Owner Author

JoshK2 commented Sep 12, 2019

Hey @exia
Yes, I want to add the option of sizing as I do with the react spinners project, but in some component, you need to calculate this with percentage.
Like I do here: https://github.com/JoshK2/react-spinners-css/blob/master/src/components/Ring/index.js

The option needs to be unlimited, so, for example, if you have a div in another div, and the relation between them is 50%, so the size of inside onw one need to be size * 0.5

Thank you very much!

@exia
Copy link

exia commented Sep 12, 2019

Hey @JoshK2

Thanks for the prompt reply.

So, are you saying that units should always be sent in as a percentage? Or should we allow the option to be sent in?

I.e.

<ring-loader [size]="'60'" [units]="'px'"></ring-loader>

<ring-loader [size]="'100'" [units]="'%'"></ring-loader>

But it will default to pixels?

I'm not sure I fully understand what you're saying from the "option needs to be unlimited", and the relation between the divs?

Are you talking about divs within the component?

Sorry, just want to make sure I do it right first time!

@JoshK2
Copy link
Owner Author

JoshK2 commented Sep 12, 2019

@exia the value is number and convert it to a pixel.
"option needs to be unlimited": if the spinner is like this:

<div style="width: 100px">
  <div style="width: 50px"></div>
</div>

and the value is number, the calculation needs to be like this;

<div style="width: size px">
 <div style="width: size * 0.5 px"></div>
</div>

Thank you for the support!

@exia
Copy link

exia commented Sep 12, 2019

@JoshK2

Makes perfect sense, thanks for clarifying.

I'll get it done as soon as I get a chance (should be tonight)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants