forked from FrontendMatter/adminplus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_forms.scss
More file actions
119 lines (108 loc) · 2.2 KB
/
Copy path_forms.scss
File metadata and controls
119 lines (108 loc) · 2.2 KB
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
// replacement for .help-block (BS3)
.text-help {
color: $text-muted;
margin-top: .325rem;
display: block;
}
////////////////////////////////////////////
// BS4 (alpha.2) checkbox and radio fixes //
////////////////////////////////////////////
.radio label,
.checkbox label {
padding-left: 1.5rem;
}
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"],
.radio input[type="radio"],
.radio-inline input[type="radio"] {
margin-left: -1.5rem;
}
.radio-inline,
.checkbox-inline {
padding-left: 1.5rem;
}
// initially with position: static
// :only-child doesn't count text nodes
// which makes this rule apply to input + text as well
// not just when single input as intended
.checkbox label input:only-child,
.radio label input:only-child {
position: absolute;
}
// remove margin bottom for last-child form elements
form > *:last-child {
margin-bottom: 0;
}
// remove margin bottom for checkbox & radio when used in form-group grid columns
// in horizontal forms
.form-group > [class*="col-"] {
> .checkbox,
> .radio {
margin-bottom: 0;
}
}
//////////////////////////
// Custom form controls //
//////////////////////////
.c-input {
> input {
&:checked ~ .c-indicator {
background-color: $brand-primary;
}
&:focus ~ .c-indicator {
// the mixin is not used here to make sure there is feedback
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem $brand-primary;
}
&:active ~ .c-indicator {
background-color: lighten($brand-primary,20%);
}
}
}
.c-checkbox {
input:indeterminate ~ .c-indicator {
background-color: $brand-primary;
}
}
.c-inputs-stacked {
position: relative;
.c-input {
display: block;
line-height: 1rem;
&::after {
display: block;
margin-bottom: .5rem;
content: "";
}
&:last-child {
&,
&::after {
margin-bottom: 0;
}
}
+ .c-input {
margin-left: 0;
}
}
}
.c-select {
&:focus {
border-color: $brand-primary;
}
}
// fix input-group button
.input-group .form-control:last-child {
margin-left: -1px;
}
///////////
// Files //
///////////
// Focus state
.file input:focus ~ .file-custom {
@include box-shadow(0 0 0 .075rem #fff, 0 0 0 .2rem $brand-primary);
}
.file-custom::before {
top: auto;
}
.file {
margin-bottom: 0;
}