UNPKG

2.9 kBSCSSView Raw
1@charset "UTF-8";
2
3// input
4// --------------------------------------------------
5
6@mixin input-size($height, $padding, $fontSize, $labelPadding, $iconPadding) {
7 height: $height;
8 #{$input-prefix}-label {
9 padding-left: $labelPadding;
10 font-size: $fontSize;
11 }
12 #{$input-prefix}-inner {
13 font-size: $fontSize;
14 }
15 #{$input-prefix}-control {
16 padding-right: $iconPadding;
17 }
18 input {
19 height: $height - $input-border-width * 2;
20 // line-height: ($height - $input-border-width * 2);
21 // line-height: ($height - $input-border-width * 2) \0; // ie9 support
22 padding: 0 $padding;
23 font-size: $fontSize;
24 &::placeholder {
25 font-size: $fontSize;
26 }
27 }
28
29 // for select
30 #{$input-prefix}-text-field {
31 padding: 0 $padding;
32 font-size: $fontSize;
33 height: $height - $input-border-width * 2;
34 line-height: ($height - $input-border-width * 2); // ie9 support
35 }
36}
37
38@mixin input-size-rtl($labelPadding, $iconPadding) {
39 #{$input-prefix}-label {
40 padding-left: 0;
41 padding-right: $labelPadding;
42 }
43 #{$input-prefix}-control {
44 padding-right: 0;
45 padding-left: $iconPadding;
46 }
47}
48
49@mixin input-border-radius($size) {
50 border-radius: $size;
51 input {
52 border-radius: $size;
53 }
54 #{$input-prefix}-control {
55 border-radius: 0 $size $size 0;
56 }
57}
58
59@mixin input-icon-size($size) {
60 .#{$css-prefix}icon {
61 @include icon-size($size);
62 }
63}
64
65@mixin input-addon-size($fontSize) {
66 font-size: $fontSize;
67}
68
69// Placeholder text
70@mixin input-placeholder($color) {
71 // Firefox
72 &::-moz-placeholder {
73 color: $color;
74 opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
75 }
76 // Internet Explorer 10+
77 &:-ms-input-placeholder {
78 color: $color;
79 }
80 // Safari and Chrome
81 &::-webkit-input-placeholder {
82 color: $color;
83 }
84}
85
86@mixin input-disabled() {
87 color: $input-disabled-color;
88 border-color: $input-disabled-border-color;
89 background-color: $input-disabled-bg-color;
90 cursor: not-allowed;
91
92 &:hover {
93 border-color: $input-disabled-border-color;
94 background-color: $input-disabled-bg-color;
95 }
96}
97
98@mixin input-focus-style() {
99 border-color: $input-focus-border-color;
100 background-color: $input-focus-bg-color;
101}
102
103@mixin input-style() {
104 border: $input-border-width solid $input-border-color;
105 background-color: $input-bg-color;
106 border-radius: $form-element-medium-corner;
107
108 &:hover {
109 border-color: $input-hover-border-color;
110 background-color: $input-hover-bg-color;
111 }
112
113 &:focus {
114 @include input-focus-style();
115 }
116}
117
118@mixin input-height($height, $borderWidth, $placeholderFontSize: $default-placeholder-font-size) {
119 height: $height;
120 input {
121 height: $height - $borderWidth * 2;
122 // line-height: ($height - $borderWidth * 2) \0; // ie9 support
123
124 &::placeholder {
125 font-size: $placeholderFontSize;
126 }
127 }
128}