srid / zulip-archive

Zulip Archive viewer (statically generated HTML)
https://funprog.srid.ca
13 stars 1 forks source link

Code blocks don't follow site width #8

Closed TheMatten closed 4 years ago

TheMatten commented 4 years ago

This is mostly visible on phones: IMG_20200202_083925 We probably want them to be shown in smaller, scrollable frame, similarly to Zulip itself.

roryokane commented 4 years ago

I haven’t tested, but I think the following two CSS rules would achieve this:

.select-the-code-blocks-somehow {
  overflow: auto;
  max-width: 100%;
}

I see that Main.hs currently has custom CSS for all code, pre, tt. The styles for standalone code blocks should be added next to that section. Note that code, pre, tt cannot be the right selector to use because tt elements are inline elements, not block elements.

srid commented 4 years ago

Awesome @roryokane, that did the trick!

(Tested using Chrome dev tools; re-open if not actually fixed)