From 6523ebccb7306f94892f139f4f649196dbb97fc0 Mon Sep 17 00:00:00 2001 From: Nathan Knowler Date: Sun, 2 Jan 2022 14:12:20 -0600 Subject: [PATCH] refactor: remove JavaScript detection (#2916) JavaScript detection with a class name on the body or html element tends to go unused even by websites that have it set up. Instead, we recommend that developers write progressively enhanced components that are styled for non-JS usage by default. Increase specificity, use the cascade, or code split to apply progressively enhanced styles. --- index.php | 2 +- resources/scripts/app.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 5fbc416..2738f4a 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,7 @@ - > + > diff --git a/resources/scripts/app.js b/resources/scripts/app.js index 8c52438..11eb22a 100644 --- a/resources/scripts/app.js +++ b/resources/scripts/app.js @@ -1,12 +1,10 @@ import {domReady} from '@scripts/components'; /** - * Remove `.no-js` from document body - * when DOM has loaded. + * Run the application when the DOM is ready. */ domReady(() => { - document.body.classList.contains('no-js') && - document.body.classList.remove('no-js'); + // Application code. }); /**