sidewayss / html-elements

Autonomous custom HTML elements with external template files
MIT License
0 stars 0 forks source link

Element height grows but doesn't shrink with font size #2

Closed sidewayss closed 1 month ago

sidewayss commented 1 month ago

If you set the font size below 16px in the in-number.html app page, the height of the element does not shrink. The height grows automatically at font sizes greater than 16px.

Not sure of the cause. It might be something in template-number.html. It might be a CSS setting I'm missing.

sidewayss commented 1 month ago

Solved by this commit: https://github.com/sidewayss/html-elements/commit/58c60dddf198b1867e10ccd3fa021189c92d08f2

Setting this.#svg.style.height = "auto" prior to getting this.clientHeight allows the element's height to adjust to a new font size.