mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix font size for input elements in viewer UI
This commit is contained in:
parent
c58c1e1a4c
commit
1fd071971b
@ -4,7 +4,6 @@ from __python__ import hash_literals
|
|||||||
|
|
||||||
from dom import build_rule, clear, svgicon, create_keyframes, set_css, change_icon_image, add_extra_css, ensure_id
|
from dom import build_rule, clear, svgicon, create_keyframes, set_css, change_icon_image, add_extra_css, ensure_id
|
||||||
from elementmaker import E
|
from elementmaker import E
|
||||||
from utils import is_ios
|
|
||||||
|
|
||||||
from book_list.theme import get_color
|
from book_list.theme import get_color
|
||||||
|
|
||||||
@ -215,20 +214,16 @@ add_extra_css(def():
|
|||||||
ans += create_button.style + '\n'
|
ans += create_button.style + '\n'
|
||||||
ans += create_spinner.style + '\n'
|
ans += create_spinner.style + '\n'
|
||||||
ans += Breadcrumbs.STYLE_RULES + '\n'
|
ans += Breadcrumbs.STYLE_RULES + '\n'
|
||||||
if is_ios:
|
# Chrome hardcodes the size of these to 13.3px. In safari on some devices
|
||||||
# Apple sets the default font size for these too small in its
|
# the font size is smaller than the body font size and small enough to
|
||||||
# browser css and then zooms in on them making them unusable.
|
# trigger page zooms. So set it to 1em so they scale with body font size.
|
||||||
# This of course means we need to hardcode a font size for these so in
|
ans += '''
|
||||||
# the future when Apple's idiot designers decide they want to change
|
select, textarea, input[type="text"], input[type="password"],
|
||||||
# the default font sizes, things will break again
|
input[type="datetime"], input[type="datetime-local"],
|
||||||
# https://blog.osmosys.asia/2017/01/05/prevent-ios-from-zooming-in-on-input-fields/
|
input[type="date"], input[type="month"], input[type="time"],
|
||||||
ans += '''
|
input[type="week"], input[type="number"], input[type="email"],
|
||||||
select, textarea, input[type="text"], input[type="password"],
|
input[type="url"], input[type="search"] { font-size: 1em }
|
||||||
input[type="datetime"], input[type="datetime-local"],
|
'''
|
||||||
input[type="date"], input[type="month"], input[type="time"],
|
|
||||||
input[type="week"], input[type="number"], input[type="email"],
|
|
||||||
input[type="url"] { font-size: 16px }
|
|
||||||
'''
|
|
||||||
return ans
|
return ans
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user