forked from jonstipe/number-polyfill
/
number-polyfill.scss
109 lines (100 loc) · 2.96 KB
/
number-polyfill.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
/*! HTML5 Number polyfill | Jonathan Stipe | https://github.com/jonstipe/number-polyfill*/
@mixin box-sizing($data) {
-moz-box-sizing: $data;
-webkit-box-sizing: $data;
box-sizing: $data;
}
@mixin border-radius($data...) {
-moz-border-radius: $data;
-webkit-border-radius: $data;
border-radius: $data;
}
@mixin inline-block {
display: -moz-inline-stack;
display: inline-block;
vertical-align: top;
zoom: 1;
*display: inline;
}
$btn-border-highlight: #ededed;
$btn-border-shadow: #777777;
$btn-bg: #CCCCCC;
$btn-border-highlight-active: #5e5e5e;
$btn-border-shadow-active: #d8d8d8;
$btn-bg-active: #999999;
div.number-spin-btn-container {
@include inline-block;
position: relative;
vertical-align: bottom;
margin: 0 0 0 1px;
padding: 0;
}
div.number-spin-btn {
@include box-sizing(border-box);
border: {
width: 1px;
color: #ddd #bbb #999;
style: solid;
}
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 0%, #dddddd 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#dddddd));
background: -webkit-linear-gradient(top, #ffffff 0%,#dddddd 100%);
background: -o-linear-gradient(top, #ffffff 0%,#dddddd 100%);
background: -ms-linear-gradient(top, #ffffff 0%,#dddddd 100%);
background: linear-gradient(to bottom, #ffffff 0%,#dddddd 100%);
color: #333;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#dddddd',GradientType=0 );
// font-family: Lucida Console, Monaco, monospace;
font-size: 11px;
padding: 0;
text-align: center;
width: 1.5em;
&:hover {
cursor: pointer;
}
&:active {
border: {
width: 1px;
color: $btn-border-highlight-active $btn-border-shadow-active $btn-border-shadow-active $btn-border-highlight-active;
style: solid;
}
background-color: $btn-bg-active;
}
}
div.number-spin-btn-up {
border-bottom-width: 1px;
@include border-radius(3px 3px 0px 0px);
&:active {
border-bottom-width: 1px;
}
}
div.number-spin-btn-down {
border-top-width: 1px;
@include border-radius(0px 0px 3px 3px);
&:active {
border-top-width: 1px;
}
}
input:disabled + div.number-spin-btn-container {
& > div.number-spin-btn-up:active,
& > div.number-spin-btn-down:active {
border: {
color: $btn-border-highlight $btn-border-shadow $btn-border-shadow $btn-border-highlight;
style: solid;
}
background-color: $btn-bg;
}
& > div.number-spin-btn-up:before,
& > div.number-spin-btn-up:active:before {
border-bottom-color: $btn-bg-active;
top: 25%;
left: 50%;
}
& > div.number-spin-btn-down:before,
& > div.number-spin-btn-down:active:before {
border-top-color: $btn-bg-active;
top: 75%;
left: 50%;
}
}