Handle no-script styling using media query
This commit is contained in:
parent
efb0f03be8
commit
591ea6b976
@ -130,16 +130,6 @@ const isIOS = parser.getOS().name === "iOS";
|
|||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
<noscript>
|
|
||||||
<style is:global>
|
|
||||||
.when-js {
|
|
||||||
display: none !important;
|
|
||||||
visibility: none !important;
|
|
||||||
opacity: 0 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</noscript>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@ -815,14 +805,26 @@ const isIOS = parser.getOS().name === "iOS";
|
|||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (scripting: none) {
|
||||||
|
.when-js {
|
||||||
|
display: none !important;
|
||||||
|
visibility: none !important;
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (scripting: enabled) {
|
||||||
|
.when-no-js {
|
||||||
|
display: none !important;
|
||||||
|
visibility: none !important;
|
||||||
|
opacity: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{/* ------------------------------------------- JS --------------------------------------------- */}
|
{/* ------------------------------------------- JS --------------------------------------------- */}
|
||||||
|
|
||||||
<script is:inline>
|
|
||||||
Array.from(document.querySelectorAll(".when-no-js")).forEach((node) => node.remove());
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script is:inline>
|
<script is:inline>
|
||||||
document.querySelectorAll("a").forEach((element) => {
|
document.querySelectorAll("a").forEach((element) => {
|
||||||
const href = element.getAttribute("href");
|
const href = element.getAttribute("href");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user