mirror of
https://github.com/docusealco/docuseal.git
synced 2026-08-07 07:14:43 +00:00
22 lines
674 B
JavaScript
22 lines
674 B
JavaScript
export default class extends HTMLElement {
|
|
connectedCallback () {
|
|
const originalFontValue = this.field.style.fontSize
|
|
|
|
if (this.field.scrollHeight > this.field.clientHeight) {
|
|
this.field.style.fontSize = `calc(${originalFontValue} / 1.5)`
|
|
this.field.style.lineHeight = `calc(${this.field.style.fontSize} * 1.3)`
|
|
|
|
if (this.field.scrollHeight > this.field.clientHeight) {
|
|
this.field.style.fontSize = `calc(${originalFontValue} / 2.0)`
|
|
this.field.style.lineHeight = `calc(${this.field.style.fontSize} * 1.3)`
|
|
}
|
|
}
|
|
|
|
this.field.classList.remove('hidden')
|
|
}
|
|
|
|
get field () {
|
|
return this.closest('field-value')
|
|
}
|
|
}
|