edwardtufte / tufte-css

Style your webpage like Edward Tufte’s handouts.
https://edwardtufte.github.io/tufte-css/
MIT License
5.99k stars 459 forks source link

div > pre > code not so good #157

Closed fulldecent closed 4 years ago

fulldecent commented 4 years ago

I am using the following code for my code snippets:

div > pre > code

The result is that an extra-wide box appears, which is suboptimal.

Screen Shot 2020-07-22 at 11 56 33
daveliepmann commented 4 years ago

Is there a section wrapping that div? From the demo/usage document:

Organize your document with an article element inside your body tag. Inside that, use section tags around each logical grouping of text and headings.

It would be helpful to share a minimal example as text, so the issue can be easily reproduced.

fulldecent commented 4 years ago

Minimal example:

https://jsbin.com/varukulesi

daveliepmann commented 4 years ago

This appears to be a function of third-party code highlighting the pre rather than the code.

daveliepmann commented 4 years ago

@fulldecent Any further findings on this?

fulldecent commented 4 years ago

Yes, the highlighter was styling the div.

I did this workaround for Rogue.

.highlight {
  background: none
}

But that is out of scope for this project so I'll call this an incompatibility of Rogue with tufte.css's wide block approach.