Skip to content

Commit

Permalink
Optimize header-anchor style
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Jun 12, 2020
1 parent 701f628 commit 6bd195a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ social_icons:

# Blog rolls
links_settings:
icon: fa fa-link
icon: fa fa-globe
title: Links
# Available values: block | inline
layout: block
Expand Down
3 changes: 1 addition & 2 deletions source/css/_common/components/pages/schedule.styl
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@
&::before {
animation: dot-flash 1s alternate infinite ease-in-out;
color: white;
content: '\f111';
display: inline-block;
font-size: 10px;
margin-right: 25px;
vertical-align: middle;
font-family-icons();
font-family-icons('\f111');
}
}

Expand Down
22 changes: 15 additions & 7 deletions source/css/_common/components/post/post-expand.styl
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,28 @@
h1, h2, h3, h4, h5, h6 {
padding-top: 10px;

.header-anchor {
// Supported plugins: hexo-renderer-markdown-it hexo-renderer-marked
.header-anchor, .headerlink {
border-bottom-style: none;
color: $grey-light;
color: inherit;
float: right;
font-size: $font-size-small;
margin-left: 10px;
visibility: hidden;
opacity: 0;

&:hover {
color: inherit;
&::before {
font-family-icons('\f0c1');
}
}

&:hover .header-anchor {
visibility: visible;
&:hover {
.header-anchor, .headerlink {
opacity: .5;

&:hover {
opacity: 1;
}
}
}
}

Expand Down
3 changes: 1 addition & 2 deletions source/css/_common/outline/header/bookmark.styl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@

&::before {
color: unquote(hexo-config('bookmark.color'));
content: '\f02e';
font-size: 32px;
line-height: 1;
font-family-icons();
font-family-icons('\f02e');
}
}

Expand Down
5 changes: 4 additions & 1 deletion source/css/_mixins.styl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ flex-column() {
justify-content: center;
}

font-family-icons() {
font-family-icons($icon = '') {
if ($icon) {
content: $icon;
}
font-family: 'Font Awesome 5 Free';
font-weight: 900;
}

0 comments on commit 6bd195a

Please sign in to comment.