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

Changing inner and outer text font size #45

Open
M4v3r1cK87 opened this issue Apr 15, 2021 · 6 comments
Open

Changing inner and outer text font size #45

M4v3r1cK87 opened this issue Apr 15, 2021 · 6 comments

Comments

@M4v3r1cK87
Copy link

M4v3r1cK87 commented Apr 15, 2021

Hello,
I've changed the js source code to receipt font-size value (in pixel) for the inner and the outer gauge.

This is my code:

  • In the config section, add this lines:
    if (!this.config.fontsize) { this.config.fontsize = 20; } if (!this.config.outer.fontsize) { this.config.outer.fontsize = this.config.fontsize; } if (!this.config.inner.fontsize) { this.config.inner.fontsize = this.config.fontsize; }
  • In the "_createCard()" function, add this lines:
    if (this.config.outer.fontsize) { this._setCssVariable(this.nodes.content, 'outer-font-size', this.config.outer.fontsize + 'px'); } if (this.config.inner.fontsize) { this._setCssVariable(this.nodes.content, 'inner-font-size', this.config.inner.fontsize + 'px'); }
  • In the "_initStyles()" function, and this lines:
    --outer-font-size: var(--outer-font-size); --inner-font-size: var(--inner-font-size);
    and
  1. Into the ".gauge-value-inner, .gauge-label-inner", add this lines:
    font-size: var(--inner-font-size);
  2. Into the ".gauge-value-outer, .gauge-label-outer", add this lines:
    font-size: var(--outer-font-size);
@posydon
Copy link

posydon commented Apr 27, 2021

hello!! possibly full config?

@Rocka84
Copy link
Collaborator

Rocka84 commented May 9, 2021

@M4v3r1cK87 Although I'm currently not actively working on this card I'm always open for pull request.

Techwolf12 added a commit to Techwolf12/dual-gauge-card that referenced this issue Sep 5, 2021
@navycrow
Copy link

navycrow commented Nov 1, 2022

@M4v3r1cK87 Hello, I tried to add lines you've mentionned. But it doesn't work.
Could you post the entire modified file, pls ?
thx

@M4v3r1cK87
Copy link
Author

I've created now a Pull request with the modification.
@Rocka84 please, can you review my code and commit to the master branch?

Thank you
Best Regards

@navycrow
Copy link

navycrow commented Nov 1, 2022

thx

@sammyke007
Copy link

sammyke007 commented Mar 22, 2023

Did this ever get merged?

both fontsize: as font-size: don't work for me after merging the code?

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

No branches or pull requests

5 participants