Skip to content

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

@goranmoomin

Description

@goranmoomin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions