Mottie / Keyboard

Virtual Keyboard using jQuery ~
http://mottie.github.io/Keyboard/
Other
1.78k stars 723 forks source link

can't adjust width of keys #708

Closed lokeecoyote closed 5 years ago

lokeecoyote commented 5 years ago

I am trying to reduce the width of the keys but there seems to be a minimum width based on the font size. No matter what I do with css width, the keys reach a minimum width for that font size and will not get any smaller. The text within a button is for example 45px wide. The button containing this text will not reduce inner width below 85px (not counting padding and margin). The text has no padding or margin. This was ok when I was building a numeric keypad, but it is forcing me to use a much smaller font than I'd like to get the button widths I need to fit.

Mottie commented 5 years ago

Hi @lokeecoyote!

In the css, a min-width is set on the button. In this case, you'll need to set the width & min-width to reduce the width (demo):

.ui-keyboard-button {
  width: 20px;
  min-width: 20px;
}

.ui-keyboard-space {
  width: 100px;
}
lokeecoyote commented 5 years ago

Thanks!