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.
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
<?php wp_head(); ?>
|
<?php wp_head(); ?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body <?php body_class('no-js'); ?>>
|
<body <?php body_class(); ?>>
|
||||||
<?php wp_body_open(); ?>
|
<?php wp_body_open(); ?>
|
||||||
<?php do_action('get_header'); ?>
|
<?php do_action('get_header'); ?>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import {domReady} from '@scripts/components';
|
import {domReady} from '@scripts/components';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove `.no-js` from document body
|
* Run the application when the DOM is ready.
|
||||||
* when DOM has loaded.
|
|
||||||
*/
|
*/
|
||||||
domReady(() => {
|
domReady(() => {
|
||||||
document.body.classList.contains('no-js') &&
|
// Application code.
|
||||||
document.body.classList.remove('no-js');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user