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

Add background <circle> element, to allow inverted colors #21

Closed
Kikobeats opened this issue Jul 21, 2017 · 3 comments
Closed

Add background <circle> element, to allow inverted colors #21

Kikobeats opened this issue Jul 21, 2017 · 3 comments

Comments

@Kikobeats
Copy link

Kikobeats commented Jul 21, 2017

First of all, nice component!

I need to use it using a background color for the round, and a white or semi transparent line.

Because the component is drawing just the line, how to do that?

something like that: https://codepen.io/web-tiki/pen/qEGvMN

@Kikobeats Kikobeats changed the title invert color invert colors Jul 21, 2017
@kevinsqi
Copy link
Owner

yea we'd need to add a new <circle> element in order to do that, which doesn't exist yet. Seems pretty reasonable to add.. I can look into it but PRs are welcome too.

@kevinsqi kevinsqi changed the title invert colors Add background <circle> element, to allow inverted colors Aug 28, 2017
@andreysaleba
Copy link
Contributor

andreysaleba commented Sep 10, 2017

Hey, I've submitted PR with the <circle> element. Can you check it - #23 ?

@kevinsqi
Copy link
Owner

This is now available in v0.4.0! Example usage:

JSX:

<CircularProgressbar
  className="inverted"
  background
  percentage={66}
/>

CSS:

.CircularProgressbar.inverted .CircularProgressbar-background {
  fill: #3e98c7;
}

.CircularProgressbar.inverted .CircularProgressbar-text {
  fill: #fff;
}

.CircularProgressbar.inverted .CircularProgressbar-path {
  stroke: #fff;
}

.CircularProgressbar.inverted .CircularProgressbar-trail {
  stroke: transparent;
}

You can also use a backgroundPadding prop to control the spacing between the background edge and the progressbar.

Thanks @Kikobeats for the idea and @andreysaleba for contributing the original PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants