summaryrefslogtreecommitdiffstats
path: root/src/objects/_text-field.scss
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects/_text-field.scss')
-rw-r--r--src/objects/_text-field.scss36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/objects/_text-field.scss b/src/objects/_text-field.scss
index e9330ce..1e18f0a 100644
--- a/src/objects/_text-field.scss
+++ b/src/objects/_text-field.scss
@@ -37,6 +37,11 @@
37 --border-width: fn.global-dim(--border-width --thin), 37 --border-width: fn.global-dim(--border-width --thin),
38 --border-radius: 2px, 38 --border-radius: 2px,
39 39
40 --extended: (
41 --pad: fn.global-dim(--size --50),
42 --border-radius: 6px,
43 ),
44
40 --focus: ( 45 --focus: (
41 --border-width: fn.global-dim(--border-width --medium), 46 --border-width: fn.global-dim(--border-width --medium),
42 ) 47 )
@@ -87,7 +92,8 @@
87 ), 'colors'); 92 ), 'colors');
88 93
89 @include iro.bem-object(iro.props-namespace()) { 94 @include iro.bem-object(iro.props-namespace()) {
90 $line-height: 1.4; 95 $line-height: 1.4;
96 $focus-border-offset: calc(fn.dim(--border-width) - fn.dim(--focus --border-width));
91 97
92 position: relative; 98 position: relative;
93 min-width: 0; 99 min-width: 0;
@@ -133,14 +139,12 @@
133 outline: 0; 139 outline: 0;
134 140
135 @include iro.bem-sibling-elem('bg') { 141 @include iro.bem-sibling-elem('bg') {
136 $offset: calc(fn.dim(--border-width) - fn.dim(--focus --border-width)); 142 top: $focus-border-offset;
137 143 right: $focus-border-offset;
138 top: $offset; 144 bottom: $focus-border-offset;
139 right: $offset; 145 left: $focus-border-offset;
140 bottom: $offset;
141 left: $offset;
142 border: fn.dim(--focus --border-width) solid fn.color(--focus --border); 146 border: fn.dim(--focus --border-width) solid fn.color(--focus --border);
143 border-radius: calc(fn.dim(--border-radius) - $offset); 147 border-radius: calc(fn.dim(--border-radius) - $focus-border-offset);
144 box-shadow: fn.color(--focus --shadow); 148 box-shadow: fn.color(--focus --shadow);
145 } 149 }
146 } 150 }
@@ -150,6 +154,22 @@
150 } 154 }
151 } 155 }
152 156
157 @include iro.bem-modifier('extended') {
158 padding: fn.dim(--extended --pad);
159
160 @include iro.bem-multi('&', 'elem' 'bg') {
161 border-radius: calc(fn.dim(--border-radius) + fn.dim(--extended --pad));
162 }
163
164 @include iro.bem-elem('native') {
165 &:focus {
166 @include iro.bem-sibling-elem('bg') {
167 border-radius: calc(fn.dim(--extended --border-radius) - $focus-border-offset);
168 }
169 }
170 }
171 }
172
153 @include iro.bem-is('invalid') { 173 @include iro.bem-is('invalid') {
154 @include iro.bem-elem('native') { 174 @include iro.bem-elem('native') {
155 @include invalid; 175 @include invalid;