-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Style back-to-top button to make sidebar more comfortable #1367
Conversation
Thanks so much for opening your first PR here! |
I think the cause of the problem is the back-to-top button. Without back-to-top enabled, there would be too much white space. You can try to style the back-to-top button to make it look better. However, there are some js files that need to be changed accordingly: hexo-theme-next/source/js/utils.js Line 324 in 4992cf7
|
unsubscribe
…------------------ 原始邮件 ------------------
发件人: "BackRunner"<notifications@github.com>;
发送时间: 2020年2月5日(星期三) 下午3:51
收件人: "theme-next/hexo-theme-next"<hexo-theme-next@noreply.github.com>;
抄送: "Subscribed"<subscribed@noreply.github.com>;
主题: Re: [theme-next/hexo-theme-next] Make links-of-blogroll more comfortable (#1367)
I think the cause of the problem is the back-to-top button. Without back-to-top enabled, there would be too much white space.
How about adding an extra margin to .back-to-top-on?
Here's my codes:
.back-to-top { margin: -4px -10px -18px; } .back-to-top-on { margin-top: 16px; }
In the original style, the back2top button looks like overflow, so I set the bottom margin to -18px.
After applying these styles:
With back2top button:
Without back2top button:
With friend links:
I don't know if the dynamic height of sidebar could cause some problem.
I changed the lines you mentioned like this:
// Margin of sidebar b2t: -4px -10px -18px, brings a different of 22px. if (CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') sidebarSchemePadding += (sidebarOffset * 2) - 22;
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@@ -15,6 +15,7 @@ | |||
&.back-to-top-on { | |||
cursor: pointer; | |||
opacity: $b2t-opacity; | |||
margin-top: 16px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest reducing the margin here from 16px to 8px. This line of code affects all four schemes, not just Pisces and Gemini. 16px is too big for the other two schemes (Muse and Mist).
margin-top: 16px; | |
margin-top: 8px; |
And it looks like this after modification
Do you have a better suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is acceptable, I think the following line could be better:
margin-top: ($scheme == 'Muse' || $scheme == 'Mist') ? -4px : 16px;
IMO, the best way is only apply this patch to Pisces and Gemini, put my patch into the scheme file (/source/css/_schemes/Pisces/_sidebar.styl), but that could make project more difficult to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put codes into scheme file can avoid the position of back-to-top button to be too high.
Cause the final margin-top in .back-to-button changed from 8px to -4px, so the button will be higher than before when Muse or Mist is enabled (in the post pages), but the original margin-top seems more suitable.
So what's your opinion about this?
…debar set to false
Congrats on merging your first pull request here! 🎉 How awesome! |
Add margin-bottom: 10px to the root div, to make this part more comfortable.
Just a style patch.
PR Checklist
PR Type
What is the current behavior?
Issue resolved: N/A
What is the new behavior?
Before adding an extra margin:
Seems like the bottom of the links-of-blogroll is too narrow, may cause a weird feeling.
After applied this change:
https://io.backrunner.top
You can see the part on the left.
Does this PR introduce a breaking change?