Skip to content

Commit 4b6967b

Browse files
committed
Fix for IE9, since it doesn't support linear gradient
1 parent e245437 commit 4b6967b

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

public/form.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ button,
4646
[type="checkbox"]+i,
4747
[type="radio"]+i,
4848
select+i {
49+
background: rgba(0,0,0,0.35);
4950
background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(0,0,0,0.25)), to(rgba(0,0,0,0.45)));
50-
background: -o-linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.45));
5151
background: -moz-linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.45));
52+
background: -ms-linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.45));
53+
background: -o-linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.45));
5254
background: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.45));
5355
-moz-background-origin: border;
5456
background-origin: border-box;
@@ -173,6 +175,12 @@ select {
173175
z-index: 1;
174176
width: 120%;
175177
}
178+
@media (-webkit-min-device-pixel-ratio: 0) {
179+
select {
180+
padding: 0 21px 0 6px;
181+
width: auto;
182+
}
183+
}
176184
:-o-prefocus,
177185
.select>i {
178186
float: left;
@@ -187,12 +195,6 @@ select {
187195
select:focus {
188196
background: transparent;
189197
}
190-
@media (-webkit-min-device-pixel-ratio: 0) {
191-
select {
192-
padding: 0 21px 0 6px;
193-
width: auto;
194-
}
195-
}
196198
select+i {
197199
position: absolute;
198200
top: 0;

src/form.styl

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ textarea {
6868
box-shadow: inset 0 1px darken(text-back, 5%), 0 1px rgba(#fff, .3), inset 0 800px 1px -400px text-back;
6969
}
7070
button,[type="submit"],[type="checkbox"]+i,[type="radio"]+i,select+i {
71+
background: border-med;
7172
background: -webkit-gradient(linear,0 0,0 100%,from(border-light),to(border-dark));
72-
background: -o-linear-gradient(border-light, border-dark);
7373
background: -moz-linear-gradient(border-light, border-dark);
74+
background: -ms-linear-gradient(border-light, border-dark);
75+
background: -o-linear-gradient(border-light, border-dark);
7476
background: linear-gradient(border-light, border-dark);
7577
-moz-background-origin: border;
7678
background-origin: border-box;
@@ -127,6 +129,9 @@ button:focus:active,[type="submit"]:focus:active,[type="checkbox"]:focus:active+
127129
width: 11px;
128130
}
129131
@media (-webkit-min-device-pixel-ratio: 2) {
132+
/* This uses an svg file for the check on an iOS retina screen. Unfortunately,
133+
the Android browser can't render SVGs. A cleaner check for SVG support would
134+
be better here. */
130135
[type="checkbox"]+i:after {
131136
background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjExcHgiIGhlaWdodD0iMTJweCI+PHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTksMS40MWMtMC4wMywwLjA0LTAuMDgsMC4wNi0wLjEsMC4xTDMuOTcsOUwxLjk4LDYuODZDMS41NSw2LjQsMC44Myw2LjM3LDAuMzcsNi44Qy0wLjEsNy4yMy0wLjEyLDcuOTYsMC4zMSw4LjQybDIuOTgsMy4yMUMzLjUsMTEuODcsMy44MSwxMiw0LjEyLDEyYzAuMDMsMCwwLjA2LDAsMC4xLDBjMC4zNS0wLjAzLDAuNjctMC4yMiwwLjg2LTAuNTFMOSw1LjUzVjEuNDF6Ii8+PHBhdGggZD0iTTQuMTIsMTFjLTAuMzIsMC0wLjYyLTAuMTMtMC44NC0wLjM3TDAuMzEsNy40MkMtMC4xMiw2Ljk2LTAuMSw2LjI0LDAuMzcsNS44YzAuNDYtMC40MywxLjE5LTAuNCwxLjYyLDAuMDZMMy45Nyw4TDguOSwwLjUyYzAuMzUtMC41MywxLjA2LTAuNjgsMS41OS0wLjMzYzAuNTMsMC4zNSwwLjY3LDEuMDYsMC4zMywxLjU5bC01LjczLDguNzFjLTAuMTksMC4yOS0wLjUxLDAuNDgtMC44NiwwLjUxQzQuMTksMTEsNC4xNiwxMSw0LjEyLDExeiIvPjwvc3ZnPg==") no-repeat;
132137
height: 12px;
@@ -168,6 +173,15 @@ select {
168173
/* Select needs to be at least 17px wider than the container to hide the arrow */
169174
width: 120%;
170175
}
176+
@media (-webkit-min-device-pixel-ratio: 0) {
177+
/* Should be webkit only */
178+
select {
179+
/* Only webkit supports fully resetting a select box */
180+
padding: 0 21px 0 6px;
181+
width: auto;
182+
}
183+
}
184+
171185
:-o-prefocus, .select>i {
172186
/* Fix bug in Opera 10 */
173187
float: left;
@@ -182,13 +196,6 @@ select {
182196
:-o-prefocus, select:focus {
183197
background: transparent;
184198
}
185-
@media (-webkit-min-device-pixel-ratio: 0) {
186-
select {
187-
/* Only WebKit supports fully resetting a select box */
188-
padding: 0 21px 0 6px;
189-
width: auto;
190-
}
191-
}
192199
select+i {
193200
position: absolute;
194201
top: 0;

0 commit comments

Comments
 (0)