Skip to content

Commit

Permalink
feat: increase anchors click area
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Oct 11, 2024
1 parent 5283a6a commit 50469f5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ <h1 data-toc-skip>{{ page.title }}</h1>
</button>

<dialog id="toc-popup" class="p-0">
<div class="header d-flex flex-row align-items-center justify-content-between ps-3">
<div class="header d-flex flex-row align-items-center justify-content-between ps-4">
<div class="label text-truncate py-2">{{- page.title -}}</div>
<button id="toc-popup-close" type="button" class="btn btn-link">
<i class="fas fa-close fa-fw"></i>
</button>
</div>
<div id="toc-popup-content" class="p-4 pt-2 ps-2"></div>
<div id="toc-popup-content" class="px-4 py-3 pb-4"></div>
</dialog>
{% endif %}

Expand Down
29 changes: 19 additions & 10 deletions _sass/layout/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -395,22 +395,31 @@ header {

ul {
list-style-type: none;
padding-left: 1.25rem;
padding-left: 0;

li {
line-height: 1.5rem;
margin-top: 0.75rem;
}
ul,
& + li {
margin-top: 0.25rem;
}

ul {
border-left: 1px solid var(--main-border-color);
margin-left: 2px;
padding-left: calc(1.25rem - 3px);
a {
display: flex;
line-height: 1.5;
padding: 0.375rem 0;
padding-right: 1.125rem;

&.toc-link::before {
display: none;
}
}
}
}

.toc-link::before {
display: none;
@for $i from 2 through 4 {
.node-name--H#{$i} {
padding-left: 1.125rem * ($i - 1);
}
}

.is-active-link {
Expand Down

0 comments on commit 50469f5

Please sign in to comment.