#background img { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; object-fit: cover; transition: transform .4s, opacity .4s !important; } #background.scaled img { transform: scale(var(--scale-factor)); } body #background img { opacity: 1; } body:not(.dark) #background img:last-child, body.dark #background img:first-child { opacity: 0; } body.dark #background:not(.scaled) img:first-child, body:not(.dark) #background:not(.scaled) img:last-child { transform: scale(var(--scale-factor)); } body.dark #background.scaled img:first-child, body:not(.dark) #background.scaled img:last-child { transform: none; } #background .notloaded { transform: scale(1) !important; opacity: 0 !important; }