-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_c-form-input.scss
132 lines (118 loc) · 2.73 KB
/
_c-form-input.scss
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* ==========================================================================
c-forms, fieldsets, controls, labels, inputs
structure of form field component:
form >
fieldset.field >
div.control >
input
label
========================================================================== */
form {
padding: .5em 1em 1em;
&:invalid button {
&:hover {
background-color: $d-button-invalid-background-color;
color: $d-button-invalid-color;
}
}
}
select.invalid:invalid,
input.invalid:invalid {
background-color: $d-input-invalid-background-color;
transition: all, 4s, ease-out;
}
/* ==========================================================================
c-fieldset
========================================================================== */
fieldset .error {
font-weight: 200;
font-style: italic;
margin-top: 0.5em;
color: color(danger);
}
fieldset,
.field {
padding-bottom: 0.6em;
}
.control {
padding-top: 0.7em;
}
/* ==========================================================================
c-input
========================================================================== */
.control {
border-bottom: 1px solid #ddd;
position: relative;
}
input,
.input {
font-size: $d-input-font-size;
box-sizing: border-box;
width: 100%;
line-height: 1.5;
height: 2.1em;
border: none;
background-color: #fff;
@include transition;
margin-top: 12px;
padding-left: 6px;
&:focus {
// border: 2px solid #aaa;
//outline: 0;
box-shadow: $d-input-box-shadow;
}
&:required::placeholder {
color: $d-input-placeholder-color;
}
}
label {
position: absolute;
font-size: $d-label-font-size;
top: 5px;
left: 4px;
color: $d-label-color;
}
input:invalid {
//TODO: replace with boxshadow
background: $d-input-invalid-background-color;
}
input:placeholder-shown + label {
opacity: 0;
}
input:not(:placeholder-shown) + label {
opacity: 0.8;
display: block;
position: absolute;
color: $d-label-color;
@include transition(opacity, 0.3s, ease-out);
&::after {
content: ' *';
color: $d-label-color;
font-size: 0.8em;
position: absolute;
padding-left: 4px;
}
}
input:not(:placeholder-shown):invalid {
background-color: $d-input-invalid-required-background-color;
@include transition($d-transition-slow);
}
//TODO: clean up
select.invalid:invalid,
input.invalid:invalid {
background-color: $d-input-invalid-required-background-color;
@include transition($d-transition-slow);
}
// Inputs
textarea,
.select select {
line-height: 1.5;
margin: 0;
padding: 0.3em 0.6em;
border: 1px solid #ccc;
background-color: #fff;
border-radius: 0.2em;
transition: all 0.3s;
display: block;
margin-bottom: 20px;
}