Skip to content

Instantly share code, notes, and snippets.

View CreatiCoding's full-sized avatar
🎯
I may be slow to respond.

정석호 CreatiCoding

🎯
I may be slow to respond.
View GitHub Profile
@CreatiCoding
CreatiCoding / hasSafeArea.js
Last active April 20, 2020 03:37 — forked from dohoons/getSafeArea.js
hasSafeArea()
function hasSafeArea() {
const div = document.createElement('div');
const computed = getComputedStyle(div);
div.style.paddingBottom = 'env(safe-area-inset-bottom)';
document.body.appendChild(div);
const bottom = parseInt(computed.paddingBottom) || 0;
document.body.removeChild(div);