diff options
Diffstat (limited to 'src/objects/_field-label.scss')
-rw-r--r-- | src/objects/_field-label.scss | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/objects/_field-label.scss b/src/objects/_field-label.scss new file mode 100644 index 0000000..ba3841a --- /dev/null +++ b/src/objects/_field-label.scss | |||
@@ -0,0 +1,86 @@ | |||
1 | @use 'iro-sass/src/iro-sass' as iro; | ||
2 | @use '../functions' as fn; | ||
3 | |||
4 | @include iro.props-namespace('field-label') { | ||
5 | @include iro.props-store(( | ||
6 | --dims: ( | ||
7 | --spacing-i: fn.global-dim(--size --150), | ||
8 | --spacing-b: fn.global-dim(--size --85), | ||
9 | --label-font-size: fn.global-dim(--font-size --75), | ||
10 | --hint-font-size: fn.global-dim(--font-size --75), | ||
11 | ), | ||
12 | --colors: ( | ||
13 | --label: fn.global-color(--text-mute), | ||
14 | --hint: fn.global-color(--text-mute), | ||
15 | --error-hint: fn.global-color(--negative --900), | ||
16 | --disabled: fn.global-color(--text-disabled), | ||
17 | ), | ||
18 | )); | ||
19 | |||
20 | @include iro.bem-object(iro.props-namespace()) { | ||
21 | display: block; | ||
22 | |||
23 | @include iro.bem-elem('label') { | ||
24 | display: block; | ||
25 | flex: 0 0 auto; | ||
26 | padding-inline-end: fn.dim(--spacing-i); | ||
27 | font-size: fn.dim(--label-font-size); | ||
28 | font-weight: 400; | ||
29 | line-height: 1.3; | ||
30 | color: fn.color(--label); | ||
31 | |||
32 | @include iro.bem-next-elem('content') { | ||
33 | margin-block-start: fn.dim(--spacing-b); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | @include iro.bem-elem('content') { | ||
38 | display: block; | ||
39 | flex: 1 1 auto; | ||
40 | } | ||
41 | |||
42 | @include iro.bem-elem('hint') { | ||
43 | display: block; | ||
44 | margin-block-start: fn.dim(--spacing-b); | ||
45 | font-size: fn.dim(--hint-font-size); | ||
46 | color: fn.color(--hint); | ||
47 | } | ||
48 | |||
49 | @include iro.bem-is('invalid') { | ||
50 | @include iro.bem-elem('hint') { | ||
51 | color: fn.color(--error-hint); | ||
52 | } | ||
53 | } | ||
54 | |||
55 | @include iro.bem-is('disabled') { | ||
56 | @include iro.bem-elem('label', 'hint') { | ||
57 | color: fn.color(--disabled); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | @include iro.bem-modifier('align-start', 'align-end') { | ||
62 | display: flex; | ||
63 | align-items: baseline; | ||
64 | |||
65 | @include iro.bem-elem('label') { | ||
66 | display: inline-block; | ||
67 | |||
68 | @include iro.bem-next-elem('content') { | ||
69 | margin-block-start: 0; | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | |||
74 | @include iro.bem-modifier('align-start') { | ||
75 | @include iro.bem-elem('label') { | ||
76 | text-align: start; | ||
77 | } | ||
78 | } | ||
79 | |||
80 | @include iro.bem-modifier('align-end') { | ||
81 | @include iro.bem-elem('label') { | ||
82 | text-align: end; | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | } | ||