mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-29 23:09:44 +01:00
967d29d83d
In addition to syncing the latest changes, this change also merges the theme’s `.scss` files and other related build tool configurations required to compile the theme’s CSS.
This will allow development of the theme to continue on Trac after 5.6 is released and the GitHub repository is archived.
For a full list of changes since [], see e7d5991...aa284fd
.
Props poena, luminuu kjellr, aristath, justinahinon.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49574
git-svn-id: http://core.svn.wordpress.org/trunk@49312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
39 lines
921 B
JavaScript
39 lines
921 B
JavaScript
/* global setTimeout */
|
|
wp.domReady( function() {
|
|
// Unregister "Wide" Separator Style.
|
|
wp.blocks.unregisterBlockStyle( 'core/separator', 'wide' );
|
|
|
|
// Add to ".block-editor__typewriter" the "is-dark-theme" class if needed.
|
|
function twentytwentyoneCopyDarkThemeClass() {
|
|
var editor,
|
|
attemptDelay = 25,
|
|
attempt = 0,
|
|
maxAttempts = 10;
|
|
|
|
if ( ! document.body.classList.contains( 'is-dark-theme' ) ) {
|
|
return;
|
|
}
|
|
|
|
editor = document.querySelector( '.block-editor__typewriter' );
|
|
if ( null === editor ) {
|
|
// Try again.
|
|
if ( attempt < maxAttempts ) {
|
|
setTimeout( function() {
|
|
twentytwentyoneCopyDarkThemeClass();
|
|
}, attemptDelay );
|
|
|
|
// Increment the attempts counter.
|
|
attempt++;
|
|
|
|
// Double the delay, give the server some time to breathe.
|
|
attemptDelay *= 2;
|
|
}
|
|
return;
|
|
}
|
|
|
|
editor.classList.add( 'is-dark-theme' );
|
|
}
|
|
|
|
twentytwentyoneCopyDarkThemeClass();
|
|
} );
|