1
- $font-size : 1rem !default ;
2
-
3
1
$font-family-sans-serif : -apple-system , BlinkMacSystemFont, ' Segoe UI' , Roboto,
4
2
' Helvetica Neue' , Arial , ' Noto Sans' , sans-serif , ' Apple Color Emoji' ,
5
3
' Segoe UI Emoji' , ' Segoe UI Symbol' , ' Noto Color Emoji' !default ;
6
- $font-family : $font-family-sans-serif !default ;
7
4
8
- $line-height : 1.5 ;
5
+ $input-line-height : 1.5 !default ;
6
+ $input-font-family : $font-family-sans-serif !default ;
7
+ $input-font-size : 1rem !default ;
8
+ $input-font-weight : 400 ;
9
+
10
+ $input-padding-y : 0.375rem !default ;
11
+ $input-padding-x : 0.75rem !default ;
12
+ $input-border-width : 1px !default ;
13
+ $input-border-color : #e9ecef !default ;
14
+ $input-bg : #fff !default ;
15
+ $input-disabled-bg : #e9ecef ;
16
+ $input-border-radius : 0.25rem !default ;
17
+
18
+ $input-transition : border-color 0.15s ease-in-out , box-shadow 0.15s ease-in-out !default ;
19
+ $input-placeholder-color : #6c757d !default ;
20
+ $input-box-shadow : inset 0 1px 1px rgba (#000 , 0.075 ) !default ;
21
+ $input-height : calc (
22
+ #{$input-line-height * 1em } + #{$input-padding-y * 2 } + #{$input-border-width *
23
+ 2 }
24
+ );
9
25
10
- $input-padding-y : 0.375rem ;
11
- $input-padding-x : 0.75rem ;
12
- $input-border-width : 1px ;
13
- $input-border-color : #e9ecef ;
14
- $input-border-radius : 0.25rem ;
15
- $input-transition : border-color 0.15s ease-in-out , box-shadow 0.15s ease-in-out ;
16
- $input-placeholder-color : #6c757d ;
26
+ $input-focus-bg : $input-bg !default ;
27
+ $input-focus-border-color : lighten ($component-active-bg , 25% ) !default ;
28
+ $input-focus-color : $input-color !default ;
29
+ $input-focus-width : $input-btn-focus-width !default ;
30
+ $input-focus-box-shadow : $input-btn-focus-box-shadow !default ;
17
31
18
- $input-error-color : #dc3545 ;
32
+ $enable-shadows : true !default ;
33
+
34
+ $input-error-color : #dc3545 !default ;
19
35
20
36
// Form groups
21
37
//
@@ -42,7 +58,7 @@ $input-error-color: #dc3545;
42
58
43
59
.form-control {
44
60
border-color : $input-error-color ;
45
- background : lighten ($input-error-color , 40 );
61
+ background-color : lighten ($input-error-color , 40 );
46
62
}
47
63
}
48
64
@@ -56,22 +72,42 @@ $input-error-color: #dc3545;
56
72
.form-control {
57
73
display : block ;
58
74
width : 100% ;
75
+ background-color : $input-bg ;
59
76
padding : $input-padding-y $input-padding-x ;
60
- font-family : $font-family ;
61
- font-size : $font-size ;
77
+ font-family : $input-font-family ;
78
+ font-size : $input-font-size ;
79
+ font-weight : $input-font-weight ;
62
80
border : $input-border-width solid $input-border-color ;
63
81
border-radius : $input-border-radius ;
82
+ box-shadow : $input-box-shadow ;
64
83
65
84
& :not (textarea ) {
66
- height : calc (
67
- #{$line-height * 1em } + #{$input-padding-y * 2 } + #{$input-border-width *
68
- 2 }
69
- );
85
+ height : $input-height ;
70
86
}
71
87
72
88
// Placeholder
73
89
& ::placeholder {
74
90
color : $input-border-color ;
75
91
opacity : 1 ;
76
92
}
93
+
94
+ & :disabled ,
95
+ & [readonly ] {
96
+ background-color : $input-disabled-bg ;
97
+ // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
98
+ opacity : 1 ;
99
+ }
100
+
101
+ & :focus {
102
+ color : $input-focus-color ;
103
+ background-color : $input-focus-bg ;
104
+ border-color : $input-focus-border-color ;
105
+ outline : 0 ;
106
+
107
+ @if $enable-shadows {
108
+ box-shadow : $input-box-shadow , $input-focus-box-shadow ;
109
+ } @else {
110
+ box-shadow : $input-focus-box-shadow ;
111
+ }
112
+ }
77
113
}
0 commit comments