It's important to remember that late night LED screen usage (and overall usage of high-contrast displays like in tablets and phones) prevents generation of melatonin which promotes sleepiness.
It's great that iOS/macOS now have night shift (and I've been loving F.lux for years), but it would be intersting to see how sleep patterns have been impacted by overall tech adoption.