harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
35 stars 30 forks source link

Reading mode has no maximum line length #2026

Open ProbablyFaiz opened 1 year ago

ProbablyFaiz commented 1 year ago

Hello! I've been using OpenCasebook for a little while now, and like it a lot for reading casebooks. Reading Mode in particular is great, but for one problem: there's no maximum line length, so on large displays it can become quite difficult to read. Here's an example (on a 27" 4K monitor):

image

Not that this is the best way to accomplish this, but just as an illustration, I'm able to make things much more readable for myself with the following style changes:

main {
    max-width: 1440px;
    margin: 0 auto;
}
main > div > article {
    max-width: 960px;
    margin-right: 10%;
}

Which produces the following layout:

image

Happy to take a stab at filing a PR for this, just let me know. Thanks!

matteocargnelutti commented 1 year ago

Hello @ProbablyFaiz !

Thank you so much for opening this issue.

You are right, this CSS needs adjustment. As you offered, it would be great if you could have a stab at submitting a PR for this 😄 .

I would simply recommend using relative units of measurement (rem, ch ...) instead of pixels for max-width to ensure this works regardless of the actual pixel density.

Thanks in advance,