Set envs to animate on loading only (except PROD) (#18)
Simply update the code with what i've been using lately so it only animate when the `.Loader` is created by react. Except for PROD where animation runs anytime. Use both the new `:has()` pseudo-class and fallback to regular `:not(:only-child())` for unsupported browser (Firefox)
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
@-moz-document domain("ppr-app.supplierxm.salsify.com"),
|
||||
domain("ppr-admin.alkemics.com") {
|
||||
domain("ppr-admin.supplierxm.salsify.com/") {
|
||||
:root {
|
||||
--stripe-size: 100px;
|
||||
--color1: hsl(194, 71%, 30%);
|
||||
--color2: hsl(194, 77%, 35%);
|
||||
--duration: 20s;
|
||||
--color1: hsla(194, 71%, 30%, 1);
|
||||
--color2: hsla(194, 77%, 35%, 1);
|
||||
--duration: 1s;
|
||||
--state: paused;
|
||||
}
|
||||
|
||||
.AuthLayoutFooter,
|
||||
.Navbar.navbar.Navbar--PPR.bg-inverse {
|
||||
background: repeating-linear-gradient(-45deg, var(--color2) 25%, var(--color1) 50%, var(--color1) 75%);
|
||||
background: repeating-linear-gradient(-45deg, var(--color2) 25%, var(--color2) 50%, var(--color1) 50%, var(--color1) 75%);
|
||||
background-color: var(--color1);
|
||||
background-size: var(--stripe-size) var(--stripe-size);
|
||||
animation: alkegrad var(--duration) linear infinite;
|
||||
animation: alkegrad var(--duration) linear 0s infinite normal var(--state);
|
||||
will-change: background-position;
|
||||
}
|
||||
|
||||
.AuthLayoutFooter {
|
||||
@@ -19,6 +22,16 @@ domain("ppr-admin.alkemics.com") {
|
||||
--duration: 40s;
|
||||
}
|
||||
|
||||
.PageTop>.navbar:where( :has(+ .Loader),
|
||||
:not(:only-child)) {
|
||||
--state: running;
|
||||
}
|
||||
|
||||
.PageTop>.Loader {
|
||||
visibility: hidden;
|
||||
animation: none;
|
||||
}
|
||||
|
||||
@keyframes alkegrad {
|
||||
from {
|
||||
background-position: 0 0;
|
||||
|
Reference in New Issue
Block a user