plclub / plclub-web

A Hakyll [plclub] website (https://www.cis.upenn.edu/~plclub/)
6 stars 20 forks source link

Indent code blocks #28

Closed Lysxia closed 4 years ago

Lysxia commented 4 years ago

Code blocks with syntax highlighting (pre.sourceCode) are currently set to margin: 0 by pygments.css. I think code blocks look better indented, which is why I added a margin: 1em to pre, but it only fires for raw code blocks, while the pygments.css rule overrides it for highlighted code blocks.

For consistency, either:

dunnl commented 4 years ago

Indentation makes sense to me. Turns out the margin is hardcoded in Skylighting here. Yikes. Their code suggests their purpose is to "collapse neighbors correctly," I'm guessing this has something to do with CSS top+bottom margin collapsing but I don't know if that's really important. (<- edited, earlier I thought we were talking about left margins for some reason).

We could ask them to make this more flexible or come up with a hack, not really sure. My sense is CSS overrides are super fragile. (Tagging @euisuny if interested---how do we override someone's CSS?)