summaryrefslogtreecommitdiffstats
path: root/src/objects
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2022-02-05 19:23:14 +0100
committerVolpeon <git@volpeon.ink>2022-02-05 19:23:14 +0100
commit3b7e35551b499a7b8887adb068d3a80e4088b0c2 (patch)
treee8aa73b422b7d112be2a9deb00c86e3b7cc77749 /src/objects
parentAdded text field (diff)
downloadiro-design-3b7e35551b499a7b8887adb068d3a80e4088b0c2.tar.gz
iro-design-3b7e35551b499a7b8887adb068d3a80e4088b0c2.tar.bz2
iro-design-3b7e35551b499a7b8887adb068d3a80e4088b0c2.zip
Added field-label
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/_field-label.scss85
-rw-r--r--src/objects/_text-field.scss5
2 files changed, 87 insertions, 3 deletions
diff --git a/src/objects/_field-label.scss b/src/objects/_field-label.scss
new file mode 100644
index 0000000..341bf49
--- /dev/null
+++ b/src/objects/_field-label.scss
@@ -0,0 +1,85 @@
1@use 'iro-sass/src/index' as iro;
2@use '../vars';
3@use '../mixins/typography';
4
5@include iro.props-namespace('field-label') {
6 @include iro.props-store((
7 --dims: (
8 --spacing-x: iro.props-get(--dims --spacing --x --sm, $global: true),
9 --spacing-y: iro.props-get(--dims --spacing --y --xs, $global: true),
10 --label-font-size: iro.props-get(--dims --font-size --sm, $global: true),
11 --hint-font-size: iro.props-get(--dims --font-size --sm, $global: true),
12 ),
13 --colors: (
14 --label: iro.props-get(--colors --fg-hi, $global: true),
15 --hint: iro.props-get(--colors --fg, $global: true),
16 --error-hint: iro.props-get(--colors --accent --error, $global: true),
17 --disabled: iro.props-get(--colors --fg-hi3, $global: true),
18 ),
19 ));
20
21 @include iro.bem-object(iro.props-namespace()) {
22 display: inline-block;
23
24 @include iro.bem-elem('label') {
25 display: block;
26 padding-right: iro.props-get(--dims --spacing-x);
27 color: iro.props-get(--colors --label);
28 font-size: iro.props-get(--dims --label-font-size);
29 font-weight: 400;
30 line-height: 1.3;
31
32 @include iro.bem-next-elem('content') {
33 margin-top: iro.props-get(--dims --spacing-y);
34 }
35 }
36
37 @include iro.bem-elem('content') {
38 display: inline-block;
39 }
40
41 @include iro.bem-elem('hint') {
42 display: block;
43 margin-top: iro.props-get(--dims --spacing-y);
44 color: iro.props-get(--colors --hint);
45 font-size: iro.props-get(--dims --hint-font-size);
46 }
47
48 @include iro.bem-is('invalid') {
49 @include iro.bem-elem('hint') {
50 color: iro.props-get(--colors --error-hint);
51 }
52 }
53
54 @include iro.bem-is('disabled') {
55 @include iro.bem-elem('label', 'hint') {
56 color: iro.props-get(--colors --disabled);
57 }
58 }
59
60 @include iro.bem-modifier('left', 'right') {
61 display: inline-flex;
62 align-items: baseline;
63
64 @include iro.bem-elem('label') {
65 display: inline-block;
66
67 @include iro.bem-next-elem('content') {
68 margin-top: 0;
69 }
70 }
71 }
72
73 @include iro.bem-modifier('left') {
74 @include iro.bem-elem('label') {
75 text-align: left;
76 }
77 }
78
79 @include iro.bem-modifier('right') {
80 @include iro.bem-elem('label') {
81 text-align: right;
82 }
83 }
84 }
85}
diff --git a/src/objects/_text-field.scss b/src/objects/_text-field.scss
index f2c3678..ac48216 100644
--- a/src/objects/_text-field.scss
+++ b/src/objects/_text-field.scss
@@ -78,9 +78,8 @@
78 @include iro.bem-elem('input') { 78 @include iro.bem-elem('input') {
79 @include typography.set-font(vars.$font--main, (size: 1em, line-height: vars.$line-height)); 79 @include typography.set-font(vars.$font--main, (size: 1em, line-height: vars.$line-height));
80 80
81 display: block; 81 color: iro.props-get(--colors --text);
82 color: iro.props-get(--colors --text); 82 resize: none;
83 resize: none;
84 83
85 &::placeholder { 84 &::placeholder {
86 opacity: 1; 85 opacity: 1;