Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color option for bookmark #1112

Merged
merged 7 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ reading_progress:
# Bookmark Support
bookmark:
enable: false
# Customize the color of the bookmark.
color: "#222"
# If auto, save the reading progress when closing the page or clicking the bookmark-icon.
# If manual, only save it by clicking the bookmark-icon.
save: auto
Expand Down
2 changes: 1 addition & 1 deletion layout/_layout.swig
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</header>

{%- if theme.bookmark.enable %}
<a class="book-mark-link book-mark-link-fixed fa fa-bookmark" href="#"></a>
<a class="book-mark-link book-mark-link-fixed" href="#"></a>
{%- endif %}

{{ partial('_partials/github-banner.swig', {}, {cache: theme.cache.enable}) }}
Expand Down
13 changes: 9 additions & 4 deletions source/css/_common/components/header/bookmark.styl
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
.book-mark-link {
border-bottom: none;
color: #222;
display: block;
font-size: 32px !important;
color: unquote(hexo-config('bookmark.color'));
display: inline-block;
left: 30px;
position: fixed;
top: -10px;
transition: .3s;

+tablet-mobile() {
display: none !important;
display: none;
}
&::before {
content: "\f02e";
font-family: $font-family-icons;
stevenjoezhang marked this conversation as resolved.
Show resolved Hide resolved
font-size: 32px;
line-height: 1;
}
}

Expand Down