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

Centering bigger text #24

Open
thebarty opened this issue May 3, 2018 · 2 comments
Open

Centering bigger text #24

thebarty opened this issue May 3, 2018 · 2 comments

Comments

@thebarty
Copy link

thebarty commented May 3, 2018

Just ran into an issue with enlarging the font-size and centering the percentage-text.

My standard css-tricks don't work here…

      <Circle
        progress={currentStateInPercent}
        progressColor={strokeColor(currentStateInPercent)}
        bgColor='#cccccc'
        lineWidth='40'
        roundedStroke={true}
        showPercentageSymbol={false}
        textColor='#bfbfbf'
        textStyle={{ 'font-size': '120px' }}
      />

If you want to make this project perfect, then it would be cool to have some easy way to adjust this…

Thanks again for your hard work!

@satiewaltz
Copy link
Collaborator

satiewaltz commented May 3, 2018

@thebarty You need to use font instead of font-size.
If you want to use just font-size you also need to provide a font-family as well.

Option A: { 'font': '120px Helvetica, Arial, sans-serif' }
Option B: { 'font-size': '120px', 'font-family': 'sans-serif' }


If your issue is more about large text not being centered, you need to increase the size property when increasing font-size:

<Circle size='200' textStyle={{ 'font-size': '120px' }}/>

@ramosmario
Copy link

I run into the same problem. Is there any update on this issue?

<Circle animate={false} responsive={false} size="170" lineWidth="15" progress={50} textStyle= {{ font: "bold 13rem Lato" }} roundedStroke={true} showPercentage={true} showPercentageSymbol={false} percentSpacing={0} />

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