Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hook on theme change to allow extensions to adapt their themes. #1900

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Carreau
Copy link
Collaborator

@Carreau Carreau commented Jun 24, 2024

Mostly thinking of jupyter-lite-sphinx which wants to sync the JupyterLab theme with pydata one.

I'm not sure this is the right approach, but at least that should get the discussion started.

Mostly thinking of jupyter-lite-sphinx which wants to sync the
JupyterLab theme with pydata one.

I'm not sure this is the right approach, but at least that should get
the discussion started.
@Carreau
Copy link
Collaborator Author

Carreau commented Jun 24, 2024

This should allow something like:

    if (window.pst_theme_change_hooks == undefined) {
        window.pst_theme_change_hooks = [];
    }
    window.pst_theme_change_hooks.push(function(evt){console.log('switched to theme', evt)});

Or should we have a register_hook function that ensure that the hook re triggered at least once when they are registered after the mode has already be set ?

@Carreau Carreau changed the title Add hook on theme change to allow extensions to adapt theit themes. Add hook on theme change to allow extensions to adapt their themes. Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant