Skip to content

Commit

Permalink
Added starter script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschmedtmann committed Aug 6, 2021
1 parent 23f0386 commit 10de6bc
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions starter/09-Omnifood-Optimizations/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
///////////////////////////////////////////////////////////
// Fixing flexbox gap property missing in some Safari versions
function checkFlexGap() {

This comment has been minimized.

Copy link
@Hcharless

Hcharless Feb 10, 2023

print hello world

This comment has been minimized.

Copy link
@scafa2002

scafa2002 Sep 10, 2023

hello world

var flex = document.createElement("div");
flex.style.display = "flex";
flex.style.flexDirection = "column";
flex.style.rowGap = "1px";

flex.appendChild(document.createElement("div"));
flex.appendChild(document.createElement("div"));

document.body.appendChild(flex);
var isSupported = flex.scrollHeight === 1;
flex.parentNode.removeChild(flex);
console.log(isSupported);

if (!isSupported) document.body.classList.add("no-flexbox-gap");
}
checkFlexGap();

// https://unpkg.com/[email protected]/dist/smoothscroll.min.js

/*
.no-flexbox-gap .main-nav-list li:not(:last-child) {
margin-right: 4.8rem;
}
.no-flexbox-gap .list-item:not(:last-child) {
margin-bottom: 1.6rem;
}
.no-flexbox-gap .list-icon:not(:last-child) {
margin-right: 1.6rem;
}
.no-flexbox-gap .delivered-faces {
margin-right: 1.6rem;

This comment has been minimized.

Copy link
@emad2262

emad2262 Jul 19, 2022

dvdx

}
.no-flexbox-gap .meal-attribute:not(:last-child) {
margin-bottom: 2rem;
}
.no-flexbox-gap .meal-icon {
margin-right: 1.6rem;
}
.no-flexbox-gap .footer-row div:not(:last-child) {
margin-right: 6.4rem;
}
.no-flexbox-gap .social-links li:not(:last-child) {
margin-right: 2.4rem;
}
.no-flexbox-gap .footer-nav li:not(:last-child) {
margin-bottom: 2.4rem;
}
@media (max-width: 75em) {
.no-flexbox-gap .main-nav-list li:not(:last-child) {
margin-right: 3.2rem;
}
}
@media (max-width: 59em) {
.no-flexbox-gap .main-nav-list li:not(:last-child) {
margin-right: 0;
margin-bottom: 4.8rem;
}
}
*/

0 comments on commit 10de6bc

Please sign in to comment.