Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code overflows container when container is smaller than code. #1

Open
goranmoomin opened this issue Jan 29, 2020 · 2 comments
Open

Comments

@goranmoomin
Copy link

Code overflows the container when the container is smaller than the code. Below is a picture in macOS Safari Responsive Design Mode where the browser is sized 800x1024. You can see that the code overflows the container, and this makes it harder to see the article in mobile browsers.

image

I believe that it can be fixed with this added to org-extra.css:

.org-src-container {
    position: relative;
}

pre.src {
    position: unset;
    overflow: auto;
}

pre.src:before {
    right: 30px;
}

It's making the pre.src:before element (the language indicator displayed when hovered) to be positioned relatively to the .org-src-container element instead of the pre.src element, and making pre.src scrollable when overflowed. (BTW, the org-default.css has lots of properties duplicated, looks like you should run a minifier to remove them.)

I believe this is a beneficial change, should I make a PR?

karlicoss added a commit that referenced this issue Jan 29, 2020
Thanks pcr910303 !
karlicoss added a commit that referenced this issue Jan 29, 2020
@karlicoss
Copy link
Owner

karlicoss commented Jan 29, 2020

@pcr910303 thanks for pointing that out and a code snippet, it works indeed!
I just commited it myself and credited you, wouldn't want to make you go through the hassle of PR as well :)

Yeah, you're righ about a minifier; cleaning up CSS a bit is on my todolist, it's grown a bit chaotically.

@KnowledgeGarden
Copy link

I see all the text justified so hard left on a Mac in both Safari and Firefox; Typically, the first letter on each line is missing. Maybe it's a trivial CSS thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants