Skip to content

Commit f4ac0f7

Browse files
committed
chore(form): prepare for pr
1 parent 6d44f7e commit f4ac0f7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/form/ux-field-theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ styles.field {
66
}
77

88
styles.field > label {
9-
font-size: 12px;
9+
font-size: ${labelFontSize};
1010
color: ${labelColor || $swatches.grey.p500};
1111
}

src/form/ux-field-theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export class UxFieldTheme {
66
public foreground: string;
77

88
public labelColor: string = '#444';
9+
public labelFontSize: string = '12px';
910
}

src/form/ux-field.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ export class UxField implements Themable {
2424
if (this.theme) {
2525
this.styleEngine.applyTheme(this, this.theme);
2626
}
27+
}
2728

28-
if (this.label && !this.element.closest('label')) {
29+
public attached() {
30+
if (this.label && !this.element.querySelector('label')) {
2931
const newLabel = document.createElement('label');
32+
3033
newLabel.textContent = this.label;
3134

3235
this.element.insertBefore(newLabel, this.element.firstChild);

0 commit comments

Comments
 (0)