mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-07-30 11:45:21 -04:00
add scroll-margin-top property to content sub-headings (fixes #717)
This commit is contained in:
+10
-6
@@ -114,29 +114,33 @@ code {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
// AnchorJS styles
|
||||
// sub-heading anchor styles
|
||||
.h-anchor {
|
||||
margin: 0 0.25em;
|
||||
padding: 0 0.25em;
|
||||
color: var(--medium-light) !important;
|
||||
background: none !important;
|
||||
color: var(--medium-light);
|
||||
background: none;
|
||||
font-weight: 300;
|
||||
line-height: 1;
|
||||
opacity: 0; // overridden by JS on mobile devices
|
||||
opacity: 0; // overridden on hover
|
||||
user-select: none;
|
||||
|
||||
&::before {
|
||||
content: "\0023"; // pound sign
|
||||
content: "\0023"; // pound sign `#`, done here to keep content DOM cleaner
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: var(--link) !important;
|
||||
color: var(--link);
|
||||
}
|
||||
}
|
||||
|
||||
// make anchor `#` link show up on hover over the corresponding heading
|
||||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
// offset (approximately) with sticky header so jumped-to content isn't hiding behind it
|
||||
scroll-margin-top: 90px;
|
||||
|
||||
&:hover {
|
||||
.h-anchor {
|
||||
opacity: 1;
|
||||
|
||||
Reference in New Issue
Block a user