Add extra_css for custom css injection#1950
Conversation
rgaiacs
left a comment
There was a problem hiding this comment.
It looks good to me. Before merge, can we
- use if-clause in the HTML template
- document it for the Helm chart
|
@rgaiacs Thanks! Where should I document this for the helm chart? |
I believe that the traitlets are "magic" connected to the helm chart. But it is nice to add to binderhub/helm-chart/binderhub/values.yaml Lines 42 to 51 in c07d252 config:
# These c.BinderHub properties are referenced by the Helm chart
BinderHub:
...
# extra_css: |
# .p-3.bg-light.shadow-sm.text-center {
# color: red;
# }Also mention it in the documentation I would like to merge #1923 before this one. |
|
@rgaiacs I did think about documenting |
|
Hi @paololazzari, thanks again for the PR. I noticed that this PR will only work in some scenarios. To enable custom CSS as CSS was originally design for, we also need #1952. The scenario that the solution that you proposed will not work is when you try to change some style from https://github.com/jupyterhub/binderhub/blob/main/binderhub/static/js/index.scss. For example, I was trying to change the font used in the page but using your solution resulted in |
|
My proposal was to add CSS, not replace the existing one |
|
Sorry @paololazzari for the delay to return to your pull request. #2012 created a minor conflict with this pull request. I checked and the conflict resolution is to accept both changes. Do you want to resolve the conflict or should I do it? |
|
@rgaiacs Happy for you to do it |

Fixes #1949.
I tested this locally by adding the following to
testing/local-binder-mocked-hub/binderhub_config.py:the style was loaded and the headline color changed.