Skip to content

Commit 4ea3248

Browse files
committed
style(input): further refactor style controls
refactored further to align more with material design standards without taking up too much space on the form
1 parent 25f7473 commit 4ea3248

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
ux-input-info {
1+
styles.inputinfo {
22
display: flex;
33
font-size: 14px;
44
width: 100%;
55
color: ${hintText || $design.primaryLightForeground};
66
}
77

8-
ux-input-info>.hint-text {
8+
styles.inputinfo>.hint-text,
9+
styles.inputinfo>.error-text {
910
flex-grow: 1;
1011
}
1112

12-
ux-input-info>.counter {
13+
styles.inputinfo>.error-text+.hint-text {
14+
display:none;
15+
}
16+
17+
styles.inputinfo>.counter {
1318
transition: 250ms;
19+
flex-wrap: nowrap;
20+
display: flex;
1421
}
1522

16-
ux-input.focused+ux-input-info>.counter {
23+
ux-input.focused+styles.inputinfo>.counter {
1724
color: ${$design.accent};
1825
}
1926

20-
ux-input>styles.input[disabled]+ux-input-info {
27+
ux-input>styles.input[disabled]+styles.inputinfo {
2128
display: none;
2229
}
2330

24-
.has-error+ux-input-info {
31+
.has-error+styles.inputinfo {
2532
color: ${errorAccent || $swatches.red.p500};
2633
}
34+

src/input-info/ux-input-info.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<template>
1+
<template styles.inputinfo>
22
<require from="./ux-input-info-theme"></require>
33

44
<span class="hint-text">

src/input/ux-input-theme.css

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,27 @@ ux-input {
55

66
styles.input {
77
width: 100%;
8-
padding: 16px 0 8px 0;
9-
margin-bottom: 8px;
8+
padding: 6px 0 4px 0;
9+
margin-bottom: 4px;
1010
border: 0;
1111
outline: none;
1212
padding-left:0;
1313
padding-right:0;
14-
transition: 250ms;
14+
transition: border-color 250ms ease;
1515
background-color: ${background};
16-
border-bottom: 2px solid ${foreground || $design.primaryLightForeground};
16+
border-bottom: 1px solid ${foreground || $design.primaryLightForeground};
1717
}
1818

1919
styles.input:hover,
2020
styles.input:focus {
2121
border-bottom-color: ${$design.accent};
2222
}
2323

24+
styles.input:focus {
25+
border-bottom-width: 2px;
26+
padding-bottom: 3px;
27+
}
28+
2429
styles.input[disabled],
2530
styles.input[disabled]:hover,
2631
styles.input[disabled]:focus,
@@ -34,7 +39,7 @@ ux-input {
3439
ux-input.full-width > styles.input {
3540
padding: 20px 8px;
3641
font-size: 16px;
37-
margin-bottom: 0;
42+
margin-bottom: 0;
3843
border: 1px solid ${$swatches.grey.p200};
3944
background-color: ${$swatches.white};
4045
}

src/textarea/ux-textarea-theme.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,28 @@ ux-textarea {
55
styles.textarea {
66
width: 100%;
77
height: 100%;
8-
padding: 16px 0 8px 0;
9-
margin-bottom: 8px;
8+
padding: 6px 0 4px 0;
9+
margin-bottom: 4px;
1010
border: 0;
1111
outline: none;
1212
resize: none;
1313
padding-left:0;
1414
padding-right:0;
15-
transition: 250ms;
15+
transition: border-color 250ms ease;
1616
background-color: ${background};
17-
border-bottom: 2px solid ${foreground || $design.primaryLightForeground};
17+
border-bottom: 1px solid ${foreground || $design.primaryLightForeground};
1818
}
1919

2020
styles.textarea:hover,
2121
styles.textarea:focus {
2222
border-bottom-color: ${$design.accent};
2323
}
2424

25+
styles.textarea:focus {
26+
border-bottom-width: 2px;
27+
padding-bottom: 3px;
28+
}
29+
2530
styles.textarea[disabled],
2631
styles.textarea[disabled]:hover,
2732
styles.textarea[disabled]:focus,

0 commit comments

Comments
 (0)