Skip to content

Instantly share code, notes, and snippets.

@leocavalcante
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save leocavalcante/8910069 to your computer and use it in GitHub Desktop.

Select an option

Save leocavalcante/8910069 to your computer and use it in GitHub Desktop.
PhoneGap and input sizes
  • Checkbox not a 44px square;
  • Number input not 100% large, there is some extra space;
  • Select not 44px tall;

Result

* {
-webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
-webkit-box-sizing: border-box;
}
body {
-webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
-webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
-webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */
background-color:#E4E4E4;
background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
background-image:-webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, #A7A7A7),
color-stop(0.51, #E4E4E4)
);
background-attachment:fixed;
font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
font-size:16px;
height:100%;
margin:0px;
padding:0px;
width:100%;
}
input, select {
margin: 0;
padding: 0;
border: 0;
}
.sqr-44 {
width: 44px;
height: 44px;
}
.padding-14 {
padding: 14px;
}
.height-44 {
height: 44px;
}
.full-width {
width: 100%;
}
.example {
background: #f00;
color: #fff;
text-align: center;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="format-detection" content="telephone=no">
<meta name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height">
<link rel="stylesheet" href="css/index.css" />
<title>Input Test</title>
</head>
<body>
<div>
<div class="sqr-44 example"></div>
<input type="checkbox" class="sqr-44">
</div>
<div>
<div class="example full-width">I'm 100%</div>
<input type="number" class="full-width padding-14" placeholder="input[type=number]">
</div>
<div>
<select class="height-44 full-width">
<option>select</option>
</select>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment