keyboard.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. /* keyboard - jQuery UI Widget */
  2. .ui-keyboard {
  3. text-align: center;
  4. padding: .3em;
  5. position: absolute;
  6. left: 0;
  7. top: 0;
  8. z-index: 16000;
  9. /* see issue #484 */
  10. -ms-touch-action: manipulation;
  11. touch-action: manipulation;
  12. }
  13. .ui-keyboard-has-focus {
  14. z-index: 16001;
  15. }
  16. .ui-keyboard div {
  17. font-size: 1.1em;
  18. }
  19. .ui-keyboard[contenteditable] {
  20. white-space: pre;
  21. }
  22. .ui-keyboard-button {
  23. height: 2em;
  24. min-width: 2em;
  25. margin: .1em;
  26. cursor: pointer;
  27. overflow: hidden;
  28. line-height: 2em;
  29. -moz-user-focus: ignore;
  30. }
  31. .ui-keyboard-button span {
  32. padding: 0;
  33. margin: 0;
  34. white-space: nowrap;
  35. display: inline-block;
  36. }
  37. .ui-keyboard-button-endrow {
  38. clear: left;
  39. }
  40. .ui-keyboard-space {
  41. width: 15em;
  42. }
  43. /* see http://nicolasgallagher.com/another-css-image-replacement-technique/ */
  44. .ui-keyboard-space span, .ui-keyboard-empty span {
  45. font: 0/0 a;
  46. text-shadow: none;
  47. color: transparent;
  48. }
  49. .ui-keyboard-preview-wrapper {
  50. text-align: center;
  51. position: relative;
  52. overflow: hidden;
  53. }
  54. /* width is calculated in IE, since 99% = 99% full browser width =( */
  55. .ui-keyboard-preview {
  56. text-align: left;
  57. margin: 0 0 3px 0;
  58. display: inline;
  59. width: 99%;
  60. }
  61. .ui-keyboard-keyset {
  62. text-align: center;
  63. white-space: nowrap;
  64. }
  65. .ui-keyboard-input {
  66. text-align: left;
  67. }
  68. .ui-keyboard-input-current {
  69. -moz-box-shadow: 0 0 5px #4d90fe;
  70. -webkit-box-shadow: 0 0 5px #4d90fe;
  71. box-shadow: 0 0 5px #4d90fe;
  72. }
  73. .ui-keyboard-placeholder {
  74. color: #888;
  75. }
  76. /* disabled or readonly inputs, or use
  77. input[disabled='disabled'] { color: #f00; } */
  78. .ui-keyboard-nokeyboard {
  79. color: #888;
  80. border-color: #888;
  81. }
  82. .ui-keyboard-spacer {
  83. display: inline-block;
  84. width: 1px;
  85. height: 0;
  86. cursor: default;
  87. }
  88. .ui-keyboard-NBSP span, .ui-keyboard-ZWSP span, .ui-keyboard-ZWNJ span,
  89. .ui-keyboard-ZWJ span, .ui-keyboard-LRM span, .ui-keyboard-RLM span {
  90. font-size: 0.5em;
  91. line-height: 1.5em;
  92. white-space: normal;
  93. }
  94. /* combo key styling - toggles diacritics on/off */
  95. .ui-keyboard-button.ui-keyboard-combo.ui-state-default {
  96. border-color: #ffaf0f;
  97. }
  98. /* (in)valid inputs */
  99. button.ui-keyboard-accept.ui-keyboard-valid-input {
  100. border-color: #0c0;
  101. background: #080;
  102. color: #fff;
  103. }
  104. button.ui-keyboard-accept.ui-keyboard-valid-input:not([disabled]):hover {
  105. background: #0a0;
  106. }
  107. button.ui-keyboard-accept.ui-keyboard-invalid-input {
  108. border-color: #c00;
  109. background: #800;
  110. color: #fff;
  111. opacity: 0.5;
  112. filter: alpha(opacity=50);
  113. }
  114. button.ui-keyboard-accept.ui-keyboard-invalid-input:not([disabled]):hover {
  115. background: #a00;
  116. }
  117. /*** Caret extension definition ***/
  118. /* margin-top => is added to the caret height (top & bottom) */
  119. .ui-keyboard-caret {
  120. background: #c00;
  121. width: 1px;
  122. margin-top: 3px;
  123. }
  124. /*** jQuery Mobile definitions ***/
  125. /* jQuery Mobile styles - need wider buttons because of font size and
  126. text-overflow:ellipsis */
  127. div.ui-body.ui-keyboard button.ui-keyboard-button.ui-btn {
  128. padding: 0.5em 1em;
  129. border-color: transparent;
  130. }
  131. .ui-body .ui-keyboard-button {
  132. width: 3em;
  133. height: 3em;
  134. display: inline-block;
  135. }
  136. .ui-body .ui-keyboard-widekey {
  137. width: 5.5em;
  138. }
  139. .ui-body .ui-keyboard-space {
  140. width: 15em;
  141. }
  142. .ui-body .ui-keyboard-space span {
  143. visibility: hidden; /* hides the ellipsis */
  144. }
  145. .ui-body .ui-keyboard-keyset {
  146. line-height: 0.5em;
  147. }
  148. .ui-body input.ui-input-text, .ui-body textarea.ui-input-text {
  149. width: 95%;
  150. }
  151. /* over-ride padding set by mobile ui theme - needed because the mobile script
  152. wraps button text with several more spans */
  153. .ui-body .ui-btn-inner {
  154. height: 2em;
  155. padding: 0.2em 0;
  156. margin: 0;
  157. }
  158. .ui-body .ui-btn {
  159. margin: 0;
  160. font-size: 13px; /* mobile default size is 13px */
  161. }
  162. /* override Bootstrap excessive button padding */
  163. button.ui-keyboard-button.btn {
  164. padding: 1px 6px;
  165. }
  166. /* enable/disable icons */
  167. button.ui-keyboard-toggle span {
  168. width: .8em;
  169. height: .8em;
  170. display: inline-block;
  171. background-repeat: no-repeat;
  172. background-position: center center;
  173. background-size: contain;
  174. }
  175. /* unlocked icon (keyboard enabled) */
  176. button.ui-keyboard-toggle span {
  177. /* light theme unlocked icon - fill: #111 */
  178. background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgZmlsbD0iIzExMSI+PHBhdGggZD0iTTguNyw0LjRINy41SDUuMHYtMS45YzAtMS40LTEuMS0yLjUtMi41LTIuNWMtMS40LDAtMi41LDEuMS0yLjUsMi41djEuOWgxLjIgdi0xLjljMC0wLjcsMC42LTEuMiwxLjItMS4yczEuMiwwLjYsMS4yLDEuMnYxLjljLTAuNywwLTEuMiwwLjYtMS4yLDEuMlY4LjggYzAsMC43LDAuNiwxLjIsMS4yLDEuMmg1LjBDOS40LDEwLDEwLDkuNCwxMCw4LjhWNS42QzEwLDUuMCw5LjQsNC40LDguOCw0LjR6IE02LjYsNy40djEuMCBjMCwwLjItMC4xLDAuMy0wLjMsMC4zUzYuMCw4LjYsNi4wLDguNFY3LjRjLTAuMi0wLjEtMC4zLTAuMy0wLjMtMC41YzAtMC4zLDAuMy0wLjYsMC42LTAuNiBTNi45LDYuNiw2LjksNi45QzYuOSw3LjEsNi44LDcuMyw2LjYsNy40eiIvPjwvc3ZnPg==);
  179. }
  180. .ui-keyboard-dark-theme button.ui-keyboard-toggle span {
  181. /* dark theme unlocked icon - fill: #eee */
  182. background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgZmlsbD0iI2VlZSI+PHBhdGggZD0iTTguNyw0LjRINy41SDUuMHYtMS45YzAtMS40LTEuMS0yLjUtMi41LTIuNWMtMS40LDAtMi41LDEuMS0yLjUsMi41djEuOWgxLjIgdi0xLjljMC0wLjcsMC42LTEuMiwxLjItMS4yczEuMiwwLjYsMS4yLDEuMnYxLjljLTAuNywwLTEuMiwwLjYtMS4yLDEuMlY4LjggYzAsMC43LDAuNiwxLjIsMS4yLDEuMmg1LjBDOS40LDEwLDEwLDkuNCwxMCw4LjhWNS42QzEwLDUuMCw5LjQsNC40LDguOCw0LjR6IE02LjYsNy40djEuMCBjMCwwLjItMC4xLDAuMy0wLjMsMC4zUzYuMCw4LjYsNi4wLDguNFY3LjRjLTAuMi0wLjEtMC4zLTAuMy0wLjMtMC41YzAtMC4zLDAuMy0wLjYsMC42LTAuNiBTNi45LDYuNiw2LjksNi45QzYuOSw3LjEsNi44LDcuMyw2LjYsNy40eiIvPjwvc3ZnPg==);
  183. }
  184. /* locked icon (keyboard disabled) */
  185. button.ui-keyboard-toggle.ui-keyboard-disabled span {
  186. /* light theme locked icon - fill: #111 */
  187. background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgZmlsbD0iIzExMSI+PHBhdGggZD0iTTcuNCA0LjRWMi41YzAtMS40LTEuMS0yLjUtMi41LTIuNWMtMS40IDAtMi41IDEuMS0yLjUgMi41djEuOSBjLTAuNyAwLTEuMiAwLjUtMS4yIDEuMnYzLjFDMS4zIDkuNCAxLjggMTAgMi41IDEwaDQuOWMwLjcgMCAxLjItMC42IDEuMi0xLjJWNS42IEM4LjcgNC45IDguMSA0LjQgNy40IDQuNHogTTUuMyA3LjR2MS4wYzAgMC4yLTAuMSAwLjMtMC4zIDAuM2MtMC4yIDAtMC4zLTAuMS0wLjMtMC4zVjcuNCBjLTAuMi0wLjEtMC4zLTAuMy0wLjMtMC41YzAtMC4zIDAuMy0wLjYgMC42LTAuNmMwLjMgMCAwLjYgMC4zIDAuNiAwLjYgQzUuNiA3LjEgNS41IDcuMyA1LjMgNy40eiBNNi4yIDQuNEgzLjdWMi41YzAtMC43IDAuNS0xLjIgMS4yLTEuMmMwLjcgMCAxLjIgMC42IDEuMiAxLjIgVjQuNHoiLz48L3N2Zz4=);
  188. }
  189. .ui-keyboard-dark-theme button.ui-keyboard-toggle.ui-keyboard-disabled span {
  190. /* dark theme locked icon - fill: #eee */
  191. background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgZmlsbD0iI2VlZSI+PHBhdGggZD0iTTcuNCA0LjRWMi41YzAtMS40LTEuMS0yLjUtMi41LTIuNWMtMS40IDAtMi41IDEuMS0yLjUgMi41djEuOSBjLTAuNyAwLTEuMiAwLjUtMS4yIDEuMnYzLjFDMS4zIDkuNCAxLjggMTAgMi41IDEwaDQuOWMwLjcgMCAxLjItMC42IDEuMi0xLjJWNS42IEM4LjcgNC45IDguMSA0LjQgNy40IDQuNHogTTUuMyA3LjR2MS4wYzAgMC4yLTAuMSAwLjMtMC4zIDAuM2MtMC4yIDAtMC4zLTAuMS0wLjMtMC4zVjcuNCBjLTAuMi0wLjEtMC4zLTAuMy0wLjMtMC41YzAtMC4zIDAuMy0wLjYgMC42LTAuNmMwLjMgMCAwLjYgMC4zIDAuNiAwLjYgQzUuNiA3LjEgNS41IDcuMyA1LjMgNy40eiBNNi4yIDQuNEgzLjdWMi41YzAtMC43IDAuNS0xLjIgMS4yLTEuMmMwLjcgMCAxLjIgMC42IDEuMiAxLjIgVjQuNHoiLz48L3N2Zz4=);
  192. }
  193. .ui-keyboard.ui-keyboard-disabled button:not(.ui-keyboard-toggle),
  194. .ui-keyboard.ui-keyboard-disabled input {
  195. opacity: 0.5;
  196. }
  197. /*** Alt-Keys Popup extension ***/
  198. /* clickable overlay on top of keyboard to hide the popup */
  199. .ui-keyboard-overlay {
  200. position: absolute;
  201. top: 0;
  202. left: 0;
  203. bottom: 0;
  204. right: 0;
  205. background: rgba(0, 0, 0, 0.5);
  206. }
  207. /* the actual popup styling, class names from the css.container option are also
  208. added */
  209. .ui-keyboard-popup {
  210. display: inline-block;
  211. /* default buttons are 2em wide + .1em margin on either side (set in
  212. .ui-keyboard-button definition); so use multiples of 2.2em for a max-width
  213. if you don't want any extra white space on the sides, e.g.
  214. 5 buttons * 2.2em = 11em,
  215. 6 buttons * 2.2em = 13.2em, etc
  216. */
  217. max-width: 22em; /* 10 buttons */
  218. }
  219. .ui-keyboard.ui-keyboard-popup-open .ui-keyboard-keyset .ui-keyboard-button {
  220. /* Disable keys under overlay while popup is open - see #654 */
  221. pointer-events: none;
  222. }
  223. /*** Extender keyboard extension ***/
  224. div.ui-keyboard-extender {
  225. margin-left: 5px;
  226. }
  227. button.ui-keyboard-extender span {
  228. width: .9em;
  229. height: .9em;
  230. display: inline-block;
  231. margin-bottom: 3px;
  232. background-repeat: no-repeat;
  233. background-position: center center;
  234. background-size: contain;
  235. /* light theme extender icon - fill: #111 */
  236. background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGw6IzExMSI+PGc+PHBhdGggc3R5bGU9ImZpbGw6bm9uZTtzdHJva2U6IzExMSIgZD0iTSAwLjUsNC41IDE1LjUsNC41IDE1LjUsMTUuNSAwLjUsMTUuNSBaIj48L3BhdGg+PHJlY3Qgd2lkdGg9IjIiIGhlaWdodD0iMiIgeD0iMiIgeT0iNiI+PC9yZWN0PjxyZWN0IHdpZHRoPSIyIiBoZWlnaHQ9IjIiIHg9IjUiIHk9IjYiPjwvcmVjdD48cmVjdCB3aWR0aD0iMiIgaGVpZ2h0PSIyIiB4PSI4IiB5PSI2Ij48L3JlY3Q+PHBhdGggZD0ibSAxMSw2IDMsMCAwLDUgLTIsMCAwLC0zIC0xLDAgeiI+PC9wYXRoPjxyZWN0IHdpZHRoPSIyIiBoZWlnaHQ9IjIiIHg9IjEyIiB5PSIxMiI+PC9yZWN0PjxyZWN0IHdpZHRoPSI2IiBoZWlnaHQ9IjIiIHg9IjUiIHk9IjEyIj48L3JlY3Q+PHJlY3Qgd2lkdGg9IjIiIGhlaWdodD0iMiIgeD0iOSIgeT0iOSI+PC9yZWN0PjxyZWN0IHdpZHRoPSIyIiBoZWlnaHQ9IjIiIHg9IjYiIHk9IjkiPjwvcmVjdD48cmVjdCB3aWR0aD0iMiIgaGVpZ2h0PSIyIiB4PSIyIiB5PSIxMiI+PC9yZWN0PjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHg9IjIiIHk9IjkiPjwvcmVjdD48L2c+PC9zdmc+);
  237. }
  238. .ui-keyboard-dark-theme button.ui-keyboard-extender span {
  239. /* dark theme extender icon - fill: #eee */
  240. background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGw6I2VlZSI+PGc+PHBhdGggc3R5bGU9ImZpbGw6bm9uZTtzdHJva2U6I2VlZSIgZD0iTSAwLjUsNC41IDE1LjUsNC41IDE1LjUsMTUuNSAwLjUsMTUuNSBaIj48L3BhdGg+PHJlY3Qgd2lkdGg9IjIiIGhlaWdodD0iMiIgeD0iMiIgeT0iNiI+PC9yZWN0PjxyZWN0IHdpZHRoPSIyIiBoZWlnaHQ9IjIiIHg9IjUiIHk9IjYiPjwvcmVjdD48cmVjdCB3aWR0aD0iMiIgaGVpZ2h0PSIyIiB4PSI4IiB5PSI2Ij48L3JlY3Q+PHBhdGggZD0ibSAxMSw2IDMsMCAwLDUgLTIsMCAwLC0zIC0xLDAgeiI+PC9wYXRoPjxyZWN0IHdpZHRoPSIyIiBoZWlnaHQ9IjIiIHg9IjEyIiB5PSIxMiI+PC9yZWN0PjxyZWN0IHdpZHRoPSI2IiBoZWlnaHQ9IjIiIHg9IjUiIHk9IjEyIj48L3JlY3Q+PHJlY3Qgd2lkdGg9IjIiIGhlaWdodD0iMiIgeD0iOSIgeT0iOSI+PC9yZWN0PjxyZWN0IHdpZHRoPSIyIiBoZWlnaHQ9IjIiIHg9IjYiIHk9IjkiPjwvcmVjdD48cmVjdCB3aWR0aD0iMiIgaGVpZ2h0PSIyIiB4PSIyIiB5PSIxMiI+PC9yZWN0PjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHg9IjIiIHk9IjkiPjwvcmVjdD48L2c+PC9zdmc+);
  241. }
  242. /* Media Queries (optimized for jQuery UI themes;
  243. may be slightly off in jQuery Mobile themes) */
  244. /* 240 x 320 (small phone) */
  245. @media all and (max-width: 319px) {
  246. .ui-keyboard div {
  247. font-size: 9px;
  248. }
  249. .ui-keyboard .ui-keyboard-input {
  250. font-size: 12px;
  251. }
  252. /* I don't own an iPhone so I have no idea how small this really is... is it
  253. even clickable with your finger? */
  254. .ui-body .ui-btn {
  255. margin: 0;
  256. font-size: 9px;
  257. }
  258. .ui-body .ui-keyboard-button {
  259. width: 1.8em;
  260. height: 2.5em;
  261. }
  262. .ui-body .ui-keyboard-widekey {
  263. width: 4em;
  264. }
  265. .ui-body .ui-keyboard-space {
  266. width: 8em;
  267. }
  268. .ui-body .ui-btn-inner {
  269. height: 2.5em;
  270. padding: 0.3em 0;
  271. }
  272. }
  273. /* 320 x 480 (iPhone) */
  274. @media all and (min-width: 320px) and (max-width: 479px) {
  275. .ui-keyboard div {
  276. font-size: 9px;
  277. }
  278. .ui-keyboard .ui-keyboard-input {
  279. font-size: 14px;
  280. }
  281. /* I don't own an iPhone so I have no idea how small this really is... is it
  282. even clickable with your finger? */
  283. .ui-body .ui-btn {
  284. margin: 0;
  285. font-size: 11px;
  286. }
  287. .ui-body .ui-keyboard-button {
  288. width: 1.8em;
  289. height: 3em;
  290. }
  291. .ui-body .ui-keyboard-widekey {
  292. width: 4.5em;
  293. }
  294. .ui-body .ui-keyboard-space {
  295. width: 10em;
  296. }
  297. .ui-body .ui-btn-inner {
  298. height: 3em;
  299. padding: 0.7em 0;
  300. }
  301. }
  302. /* 480 x 640 (small tablet) */
  303. @media all and (min-width: 480px) and (max-width: 767px) {
  304. .ui-keyboard div {
  305. font-size: 13px;
  306. }
  307. .ui-keyboard .ui-keyboard-input {
  308. font-size: 14px;
  309. }
  310. .ui-body .ui-btn {
  311. margin: 0;
  312. font-size: 10px;
  313. }
  314. .ui-body .ui-keyboard-button {
  315. height: 2.5em;
  316. }
  317. .ui-body .ui-btn-inner {
  318. height: 2.5em;
  319. padding: 0.5em 0;
  320. }
  321. }