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

katex: make it position: relative to fix broken layout #637

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

fushar
Copy link
Member

@fushar fushar commented Jul 7, 2024

The Katex's MathML output has the following CSS:

.katex .katex-mathml {
    clip: rect(1px, 1px, 1px, 1px);
    border: 0;
    height: 1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

The position: absolute rule breaks the layout when a problem is rendered within a course. This is because some course-related divs use something like height: calc(100vh - xxx) to maintain a sticky header. This is incompatible with MathML output above as it somehow sticks at the bottom of the page and causes unnecessary blank space.

With this, the MathML output does not break the layout as the parent div .katex now has position: relative.

Before After
image image

@fushar fushar merged commit 0993048 into master Jul 7, 2024
8 checks passed
@fushar fushar deleted the katex-relatif branch July 7, 2024 02:35
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

Successfully merging this pull request may close these issues.

1 participant