-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathvaadin-form-item-base-styles.js
More file actions
77 lines (65 loc) · 2.02 KB
/
vaadin-form-item-base-styles.js
File metadata and controls
77 lines (65 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* @license
* Copyright (c) 2018 - 2026 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import '@vaadin/component-base/src/styles/style-props.js';
import { css } from 'lit';
export const formItemStyles = css`
:host {
/* By default, when auto-responsive mode is disabled, labels should be displayed beside the fields. */
--_form-item-labels-above: ' '; /* false */
--_form-item-labels-aside: initial; /* true */
align-items: var(--_form-item-labels-aside, baseline);
display: inline-flex;
flex-flow: var(--_form-item-labels-above, column) nowrap;
justify-self: stretch;
}
:host([label-position='top']) {
--_form-item-labels-above: initial; /* true */
--_form-item-labels-aside: ' '; /* false */
}
:host([hidden]) {
display: none !important;
}
[part='label'] {
color: var(--vaadin-form-item-label-color, var(--vaadin-text-color));
flex: 0 0 auto;
font-size: var(--vaadin-form-item-label-font-size, inherit);
font-weight: var(--vaadin-form-item-label-font-weight, 500);
line-height: var(--vaadin-form-item-label-line-height, inherit);
position: relative;
width: var(--_form-item-labels-aside, var(--_label-width, 8em));
word-break: break-word;
box-sizing: border-box;
}
:host([required]) [part='label'] {
padding-inline-end: 1em;
}
[part='required-indicator'] {
display: inline-block;
position: absolute;
width: 1em;
text-align: center;
color: var(--vaadin-input-field-required-indicator-color, var(--vaadin-text-color-secondary));
}
[part='required-indicator']::after {
content: var(--vaadin-input-field-required-indicator, '*');
}
:host(:not([required])) [part='required-indicator'] {
display: none;
}
#spacing {
flex: 0 0 auto;
width: var(--_label-spacing, 1em);
}
#content {
flex: 1 1 auto;
min-width: 0;
}
#content ::slotted(.full-width) {
box-sizing: border-box;
min-width: 0;
width: 100%;
}
`;