jupyter-book / jupyterlab-myst

Use MyST Markdown directly in Jupyter Lab
https://jupyter-book.github.io/jupyterlab-myst/
BSD 3-Clause "New" or "Revised" License
146 stars 18 forks source link

set normal heading margins in css #114

Closed tavin closed 1 year ago

tavin commented 1 year ago

tailwindcss-typography defaults to unusually big margins

welcome[bot] commented 1 year ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

github-actions[bot] commented 1 year ago

Binder :point_left: Launch a Binder on branch tavin/jupyterlab-myst/main

rowanc1 commented 1 year ago

Nice! Excited about this. :)

I have picked up the commit in #116 and done a few other style related things when I was in there. The styles (especially the headers and linespacing) should be much more inline with classic Jupyter styles.

Thanks for the help getting this started, closing this PR in favour of the other one!

tavin commented 1 year ago

@rowanc1 I'll ask you on this thread to avoid cluttering the discussion on #116.

I note you're fixing the styles on h5-h6 as well as h1-h4. I had left h5-h6 alone because tailwind/typography didn't appear to be touching them. But it seems there are more reasons why "normal" jupyterlab styles don't get applied to content rendered by myst, and you've basically had to copypaste some boilerplate jupyterlab styles into the tailwind config?

This of course achieves the goal of a consistent experience for end users who switch -- thanking you!

I presume it's not feasible to somehow disable certain tailwind styles and just allow the jupyterlab styles through?

rowanc1 commented 1 year ago

Ah, just checking this after I have gone and merged some other things! :)

Right now the tailwind typography is pretty opinionated and we are using less and less of it, I think that we might actually just get to a place where we remove it completely, and rely on the existing styles of jupyter here.

I haven't added a class .jp-RenderedHTMLCommon to the component (led to some other problems), which is where a lot of these styles are getting applied - I think that we might have to go in that direction soon.

For the h5/h6 thing, you are right! (There was some tiny inconsistency in the color though), I saw the inconsistency looking at the two stylesheets and thought it wouldn't do any harm to bring them over for now and make them exactly the same, even though it is verbose and a bunch of duplication.

I do think that this is not the end of the style changes that we are going to have to do. And I think we will have to change things around to use the .jp-RenderedHTMLCommon class soon to support some of the inline html.

tavin commented 1 year ago

Thanks for the insights @rowanc1. For now it's going to feel a lot more usable while all that is getting figured out.

rowanc1 commented 1 year ago

Yep, lots of small improvements we can release while we figure out how to do it properly. The styles PR gets things pretty close, but there are certainly a ton of other things to work on!

Appreciate all your help! Let me know if you need any other pointers or help getting up and going with other repos. 🚀