Repository navigation
Sidebar buttons no longer aligned (multiple rows) #2797
Checklist
How did you create the site?Generated from DescriptionWith a recent update the theme selector now shows a (.) dot in the sidebar. While nice, this has the side effect that my second line of buttons no longer properly aligns.
Is there an (easy) way to fix this? Operations you have already triedI've been trying to find my way through the code where to change it, but sofar little success. Anything else?No response |
Replies: 1 comment 1 reply
|
The dot is the The fix is to give the dot exactly one button slot. Copy the theme's /* keep the dot, but let it take one full button slot */
#sidebar .sidebar-bottom .btn-group {
margin-right: 0.8rem;
}
#sidebar .sidebar-bottom .icon-border {
margin-left: calc((1.75rem - 3px) / 2);
margin-right: calc((1.75rem - 3px) / 2 + 0.8rem);
}
@media all and (min-width: 1650px) {
#sidebar .sidebar-bottom .btn-group { margin-right: 1rem; }
#sidebar .sidebar-bottom .icon-border { margin-right: calc((1.75rem - 3px) / 2 + 1rem); }
}If you'd rather drop the dot, this is enough: #sidebar .sidebar-bottom .icon-border { display: none; }
#sidebar .sidebar-bottom .btn-group { margin-right: 0.8rem; }
@media all and (min-width: 1650px) {
#sidebar .sidebar-bottom .btn-group { margin-right: 1rem; }
}I tried both on the 7.6 demo (chirpy.cotes.page) with three extra contact links so the icons wrap like in your screenshot. Without the CSS the second row is about 9px off. With the first snippet the dot takes exactly one button width, so the second row lines up with the first (its second icon sits under the dot), and the first row fits one icon less. With the second snippet the icons line up one under another. Same result at 1024px and 1700px window width. |

The dot is the
<span class="icon-border">between the theme toggle and the contact links (sidebar.html#L91-L93). It is 3px wide with 0.6rem margin on each side (_sidebar.scss#L326-L336), while every contact button takes 1.75rem plus a 0.8rem gap, or 1rem on screens 1650px and wider (_sidebar.scss#L213-L225, _variables.scss#L5-L6). So the first row gets shifted by something that isn't one button wide, and the wrapped row starts at the left edge again.The fix is to give the dot exactly one button slot. Copy the theme's
assets/css/jekyll-theme-chirpy.scssto the same path in your site (that's the documented way, see Customizing the Stylesheet) and add this at the end:/* keep the dot, but l…