// First script to run — removes the class if JS is available
document.documentElement.classList.remove('no-js');
This creates two automatic states:
* **JS on:** ''.no-js'' is removed, everything works normally
* **JS off:** ''.no-js'' stays — use it to style accordingly
===== Hiding JS-Dependent Elements =====
.no-js .js-required,
.no-js #theme-toggle,
.no-js .comments-section,
.no-js .post-graph {
display: none !important;
}
Mark interactive elements in HTML:
...
===== Explaining, Not Just Hiding =====
Hiding broken elements isn't enough — explain what's happening:
.no-js .status-container::after {
content: "Status updates require JavaScript to be enabled.";
font-style: italic;
color: var(--muted);
display: block;
padding: 1rem;
}
===== The