Make it possible to change font size on text labels#50
Open
Techwolf12 wants to merge 2 commits intocustom-cards:masterfrom
Open
Make it possible to change font size on text labels#50Techwolf12 wants to merge 2 commits intocustom-cards:masterfrom
Techwolf12 wants to merge 2 commits intocustom-cards:masterfrom
Conversation
|
Any chance to get this merged? |
Rocka84
requested changes
Mar 3, 2022
Comment on lines
+279
to
+280
| --outer-font-size: var(--outer-font-size); | ||
| --inner-font-size: var(--inner-font-size); |
Collaborator
There was a problem hiding this comment.
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; | ||
| } |
Collaborator
There was a problem hiding this comment.
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; | |
| } |
|
can this be merged? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for: #45 (Thanks @M4v3r1cK87 for this code!)
It would be really nice to have!