mirror of
https://github.com/vinta/awesome-python.git
synced 2026-03-23 22:52:21 +08:00
fix(website): center back-to-top button using left/margin instead of right
Previously used right: max(1.5rem, calc(50vw - 700px + 0.5rem)) which caused the button to overlap content at certain viewport widths. Switch to left: 50% with margin-left: -2rem to keep it centered relative to the viewport without interfering with sidebar or content layout. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -531,7 +531,8 @@ th[data-sort].sort-asc::after {
|
||||
.back-to-top {
|
||||
position: fixed;
|
||||
bottom: 2rem;
|
||||
right: max(1.5rem, calc(50vw - 700px + 0.5rem));
|
||||
left: 50%;
|
||||
margin-left: -2rem;
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 4px;
|
||||
@@ -569,7 +570,7 @@ th[data-sort].sort-asc::after {
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.back-to-top { right: 1.25rem; bottom: 1.25rem; }
|
||||
.back-to-top { bottom: 1.25rem; }
|
||||
}
|
||||
|
||||
/* === Noscript === */
|
||||
|
||||
Reference in New Issue
Block a user