AnkiDroid 2.25.1 – Cards displayed too large after update

Please paste ‘Debug Info’ (Settings > About > ‘Copy debug info’) below:

(put here)AnkiDroid Version = 2.25.1 (0c0a878221806c44f72e5d0259b290028661b567)  
Backend Version = 0.1.68-anki26.05 (26.05 e64c6b1aee3e8d668fb8bbe084beada8e070d985)  
Android Version = 10 (SDK 29)  
ProductFlavor = play  
Device Info = samsung | samsung | a50 | a50cis | SM-A505FM | exynos9610  
WebView Info = [com.google.android.webview | 801003603]: Mozilla/5.0 (Linux; Android 10; SM-A505FM Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/153.0.8010.36 Mobile Safari/537.36  
 
FSRS = 5.2.0 (Enabled: false)  
Crash Reports Enabled = true

After updating AnkiDroid to version 2.25.1, all my German flashcards are displayed approximately 10–15% larger than before.

The right edge of the cards is cut off in portrait mode. The problem also occurs in landscape mode.

I can zoom out using two fingers, and the entire card then fits correctly. However, the zoom level resets when I move to the next card.

Everything worked correctly before the update.

I reported this on GitHub, and a developer mentioned that it is related to a change in MathJax rendering and suggested posting here for further investigation.

I would prefer not to modify my card templates, since they worked correctly before the update.

Try enabling the new study screen from the settings.

If that doesn’t work, upload a sample card to Google Drive and attach the link here (if you can’t add links, leave spaces to break up the link).

Thank you for your help.

I have already tried enabling the new study screen, but it did not resolve the issue.

Here is a sample deck that reproduces the problem:

https: //drive. google. com /file/d/1yO0UzIn2TUrrj7VhuFmWHafyF-DyNPHu/view?usp=sharing

I added spaces to the link because the forum does not allow me to post links yet.

To be honest, I have no clue how your css works to center the card, but I adjusted it to use Eltaurus’s wonderful solution and it seems to work perfectly.

Try it:

* { box-sizing: border-box; }
.card {
  -webkit-tap-highlight-color: transparent;
  color: #111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
  font-size: 22px;
  text-align: left;
}

:has(> .card) {
    display: flex;
    min-height: 100%;
    justify-content: center;
    flex-direction: column;
}

.wrap {
  max-height: calc(100vh - 32px);
  overflow: auto;
  line-height: 1.4;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}

.front { background-color: skyblue; }
.back  { background-color: #d2b48c; }

.header { margin-bottom: 6px; }
.rank  { font-weight: 800; color: #000; }
.lemma { font-weight: 800; color: #0b3d91; }
.rest  { color: #111; }

.line  { margin: 4px 0; }
.de-ex { color: purple; font-weight: 700; font-style: italic; }
.meta  { color: #111; }

.en-gloss { font-weight: 800; color: #000; }
.en-ex    { color: #0a7a0a; font-weight: 700; font-style: italic; }
hr#answer { margin: 14px 0; }

Thank you for your help!

I managed to fix the issue by changing just one line in my original CSS:

width: min(95vw, 950px);

to:

width: min(100%, 950px);

The cards now fit within the screen width without horizontal scrolling.

Everything else in the original CSS remains unchanged.