Skip to content

Commit

Permalink
💄 style: fix numbered code blocks on iOS Safari
Browse files Browse the repository at this point in the history
Tables used for line numbers were inheriting incorrect font sizes on iOS Safari
due to WebKit's text size adjustment behaviour.

Short lines were being centred, too.
  • Loading branch information
welpo committed Nov 24, 2024
1 parent 123110e commit 4be8a56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sass/parts/_code.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
code {
-webkit-text-size-adjust: 100%;
border-radius: 5px;
background-color: var(--bg-1);
padding-inline: 0.2em;
Expand Down Expand Up @@ -31,7 +32,7 @@ code {
tbody td:first-child {
opacity: 50%;
padding-inline-end: 0.8rem;
width: 0rem;
width: 1px; // Without this, iOS Safari centres short lines.
user-select: none;
text-align: end;
}
Expand Down

0 comments on commit 4be8a56

Please sign in to comment.