summaryrefslogtreecommitdiffstats
path: root/tpl/objects/field-label.pug
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2024-06-22 23:00:16 +0200
committerVolpeon <git@volpeon.ink>2024-06-22 23:00:16 +0200
commit69d753931c098bc18cd23e96af18f736a772f416 (patch)
treea40beef43a215fd76972e41085d3af1b123fed32 /tpl/objects/field-label.pug
parentUpdate (diff)
downloadiro-design-69d753931c098bc18cd23e96af18f736a772f416.tar.gz
iro-design-69d753931c098bc18cd23e96af18f736a772f416.tar.bz2
iro-design-69d753931c098bc18cd23e96af18f736a772f416.zip
Update
Diffstat (limited to 'tpl/objects/field-label.pug')
-rw-r--r--tpl/objects/field-label.pug13
1 files changed, 7 insertions, 6 deletions
diff --git a/tpl/objects/field-label.pug b/tpl/objects/field-label.pug
index 151e084..fb96443 100644
--- a/tpl/objects/field-label.pug
+++ b/tpl/objects/field-label.pug
@@ -1,17 +1,18 @@
1mixin field-label(label, hint=null) 1mixin field-label(label, hint=null)
2 - 2 -
3 let classes = { 3 let classes = {
4 'o-field-label': true, 4 'o-field-label': true,
5 'o-field-label--left': attributes.align === 'left', 5 'is-invalid': attributes.invalid,
6 'o-field-label--right': attributes.align === 'right', 6 'is-disabled': attributes.disabled,
7 'is-invalid': attributes.invalid, 7 }
8 'is-disabled': attributes.disabled, 8 if (attributes.align) {
9 classes['o-field-label--align-' + attributes.align] = true;
9 } 10 }
10 if (attributes.class) { 11 if (attributes.class) {
11 classes[attributes.class] = true; 12 classes[attributes.class] = true;
12 } 13 }
13 14
14 let needsLabelWidth = attributes.align === 'left' || attributes.align === 'right'; 15 let needsLabelWidth = !!attributes.align;
15 16
16 let labelStyle = needsLabelWidth ? 'width: ' + attributes.labelWidth : ''; 17 let labelStyle = needsLabelWidth ? 'width: ' + attributes.labelWidth : '';
17 18