Skip to content

Commit

Permalink
SceneryStyle rework (allow regenerating the stylesheet) because mkdoc…
Browse files Browse the repository at this point in the history
…s material is requiring us to rebuild it. See #130
  • Loading branch information
jonathanolson committed Feb 14, 2025
1 parent f07f6ef commit 144e289
Show file tree
Hide file tree
Showing 10 changed files with 152,670 additions and 156,123 deletions.
4 changes: 2 additions & 2 deletions docs/js/createSandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const createSandbox = ( divOrId, func, providedOptions ) => {
}
}

console.log( `creating sandbox for ${id}` );
// console.log( `creating sandbox for ${id}` );

const disposeEmitter = new TinyEmitter();

Expand Down Expand Up @@ -332,7 +332,7 @@ export const createSandbox = ( divOrId, func, providedOptions ) => {
{
const interval = setInterval( () => {
if ( !parentElement.isConnected ) {
console.log(`disposing sandbox for ${id}`);
// console.log(`disposing sandbox for ${id}`);

disposeEmitter.emit();
display.dispose();
Expand Down
9 changes: 7 additions & 2 deletions docs/js/initialize-examples.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document$.subscribe( () => {
console.log( 'reloading examples' );
document$.subscribe( async () => {
// console.log( 'reloading examples' );

document.querySelectorAll( '.sandbox-example[data-example]' ).forEach( async div => {
if ( div.dataset.initialized ) {
Expand All @@ -14,4 +14,9 @@ document$.subscribe( () => {
module.initialize( div );
}
} );

// Mkdocs material seems to be wiping away our CSS. Add it back.
// See https://github.com/scenerystack/community/issues/130
const module = await import( '/lib/scenerystack.esm.min.js' );
module.reapplyGlobalStyle();
} );
Loading

0 comments on commit 144e289

Please sign in to comment.