jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

Default CSS rules being applied over _static rules

Open canyon289 opened this issue 2 years ago • 2 comments

Describe the bug

context When I use custom CSS per the docs the styles get overridden by default styles https://jupyterbook.org/en/stable/advanced/html.html#custom-css-or-javascript

expectation I expected my custom css to overwrite the jupyter book style. Here's me manually turning off the CSS rules to get the font and color I expect image

bug Here's the default image

problem This is a problem for people because I would expect my styles to overwrite the default styles

Reproduce the bug

Here is my code and jupyter book setup https://github.com/canyon289/GenAiGuidebook/blob/main/genaiguidebook/_static/rk_style.css#L13-L16

List your environment

jupyter-book==0.15.1 jupyter-cache==0.6.1 jupyter_client==8.2.0 jupyter_core==5.3.0 sphinx-jupyterbook-latex==0.5.2 myst-nb==0.17.2 myst-parser==0.18.1

canyon289 avatar May 30 '23 04:05 canyon289

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar May 30 '23 04:05 welcome[bot]

For now I'm making all my rules in my custom css as !important to globally override. It gets the job done, hoping that static style sheets take precedence over sphinx-book-theme in the future though

h1 {
    font-family: "Poppins", "Open Sans", sans-serif;
    /* margin: 0.2rem 0 0 0 ; */
    color: #00524b !important;
    font-weight: 700 !important;
}

image

canyon289 avatar Dec 26 '23 03:12 canyon289