Short Answer: Unfortunately, it is not possible.
It's interesting to see how much progress has been made in the past 4 years. However, the question of whether one can specify the iOS UI theme from inside a web app still receives a resounding NO. (And honestly, do you really want others deciding how your device looks on iOS?)
As of fall 2019, the only iOS element that can be themed from a web app is the status bar. While this is beneficial for Progressive Web Apps, it limits control over other UI elements.
A more effective approach
The original question posed by the OP was centered around supporting a dark theme, which assumes the user has chosen to activate it (especially since Night Mode timer is typically user-initiated).
In 2019, we now have the ability to accommodate the user's choice of themes. Both Android 9 and iOS 13 offer support for global dark and light themes. This means that various elements, such as the keyboard, will adhere to the selected mode. All that remains is for our web apps/sites to respect these settings as well.
This entails recognizing when a user with a "dark theme" preference loads your HTML, and then adapting your code to reflect that decision. This process is made simpler through the utilization of a CSS Media Query test called prefers-color-scheme, which includes options like no-preference, light, and dark. No preference essentially signifies default settings or lack of device support.
Implementation is straightforward. Since many developers design a "light" theme initially, adjustments can be made to incorporate darker colors as needed.
/* Avoid extreme contrasts like full black on full white
or vice versa, as they strain the eyes */
body {
background: #ffffff;
color: #333333;
font-family: Sans-Serif;
font-size: 62.5%;
/* additional styles here */
}
/* media query to override defaults */
@media (prefers-color-scheme: dark){
body {
background: #171717;
color: #f7f7f7;
}
}
Now, the appropriate keyboard will load based on the user's preference, and it is up to apps/sites to align with that choice.
Compatibility
This method supports user-defined theme preferences in Safari on iOS 13, Chrome on Android, and Safari, Chrome & Firefox on Mac OS 10.14 (Mojave).