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

Make it possible to change font size on text labels #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Techwolf12
Copy link

Pull request for: #45 (Thanks @M4v3r1cK87 for this code!)
It would be really nice to have!

@Ulrar
Copy link

Ulrar commented Feb 26, 2022

Any chance to get this merged?

Comment on lines +279 to +280
--outer-font-size: var(--outer-font-size);
--inner-font-size: var(--inner-font-size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets those variables to themselves, which doesn't do much.

Instead the default value should be set here and should be relative to --gauge-card-width, like the other font sizes.

Suggested change
--outer-font-size: var(--outer-font-size);
--inner-font-size: var(--inner-font-size);
--outer-font-size: calc(var(--gauge-card-width) / 15);
--inner-font-size: calc(var(--gauge-card-width) / 15);

Comment on lines +27 to +36

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;
}
Copy link
Collaborator

@Rocka84 Rocka84 Mar 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default values for css-variables should be set via css. See my other suggestion.
What should happen here is to use the global value for the inner and/or outer gauge, if available and no individual values are set.

Suggested change
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;
}
if (this.config.fontsize && !this.config.outer.fontsize) {
this.config.outer.fontsize = this.config.fontsize;
}
if (this.config.fontsize && !this.config.inner.fontsize) {
this.config.inner.fontsize = this.config.fontsize;
}

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

Successfully merging this pull request may close these issues.

3 participants