-
Notifications
You must be signed in to change notification settings - Fork 59
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
Theme initialisation according to JupyterLab or Voilà (lab) #135
Comments
I love this idea ❤️ |
This feature was implemented in v1.7.0 (9be42b9) |
Thanks for the implementation with respect to JupyterLab. What about adding the check for Voilà on line 39 of Theme.js? |
It should work when using Voila with e.g. |
I have tried with |
You are right, I misremembered, I was using the VoilaVuetify template in which this is handled. Would you want to make a PR for this? If not, I can make the change. |
Although it might work without that change in a future version of Voila: voila-dashboards/voila#846 |
I'll try to make a PR. I have an issue with building the extension. After modifying Themes.js, I run
If I add How do you usually rebuild ipyvuetify under development? I had a look at Jupyterlab documentation and the cookiecutter-ts extension README, but ipyvuetify seems not to follow the same structure ( |
It's based on an older js cookiecutter and is also supporting the classic notebook. I'll have to take a look why it's not building. |
Running After running |
I still get an error with
No issue with The log file from npm for build:webpack reads:
Could it come from an incompatible version of one of the compilers?
|
Can you confirm that after running My dependencies are indeed different, you should have the same after resetting
|
Yes, I gave a try with a fresh clone of ipvuetify, as follows: git clone https://github.com/mariobuikhuizen/ipyvuetify.git mario_ipyvuetify
cd mario_ipyvuetify/
pip install -e .
jupyter labextension develop . --overwrite
cd js
npm run prepare npm ends with the same error as before. |
Finally, I found the cause: the file
@mariobuikhuizen Did you run it on macOS? I am using Linux. Apparently, webpack behaves differently between macOS and Linux with respect to case sensitivity: https://stackoverflow.com/questions/28789050/webpack-fine-on-macos-loader-errors-on-linux |
Currently, after displaying a widget in Jupyterlab, |
Great find! I indeed run it on macOS, which has a case-insensitive file system. It might be useful to have |
The class names of the document's body's are checked whether they contain 'theme-light' or 'theme-dark', which indicates the theme loaded by Voilà for the lab template. The patch also adds 'dark_jlab' attribute to know the inherited theme in JupyterLab. Resolves: widgetti#135
Theme.dark
is initialised asFalse
in Themes.py and this value sets the vuetify theme in Themes.js.When JupyterLab or Voilà is set to a dark theme, the ipyvuetify widgets are rendered by default in light theme, and one has to manually execute
ipyvuetify.model.dark = True
to change the ipyvuetify theme.Could this be changed in Themes.js line 22 by adding
The first condition checks the use of a dark theme in a Voilà display (with the default lab template) and the second in JupyterLab display.
I tested it in a VuetifyTemplate and it worked.
The text was updated successfully, but these errors were encountered: