Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
feat(style): adjust style of header, tags and dynamic-to-top button
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Mar 14, 2020
1 parent d8bfd23 commit 3d9aad3
Show file tree
Hide file tree
Showing 23 changed files with 146 additions and 130 deletions.
52 changes: 26 additions & 26 deletions assets/css/_core/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ b, strong {
a {
color: $global-link-color;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;

&:hover {
color: $global-link-hover-color;
Expand All @@ -82,47 +81,48 @@ a {

b, strong {
font-weight: bold;

.dark-theme & {
color: #ddd;
}
}

#dynamic-to-top {
display: none;
overflow: hidden;
width: auto;
z-index: 90;
z-index: 100;
position: fixed;
bottom: 2rem;
right: 2rem;
top: auto;
left: auto;
font-family: sans-serif;
font-size: 1rem;
color: #fff;
text-decoration: none;
font-weight: bold;
padding: 1rem 1rem;
font-size: 1.4rem;
line-height: 1.8rem;
padding: .6rem .6rem;
color: $global-font-secondary-color;
background: $header-background-color;
border: 1px solid $global-border-color;
background: #222;
outline: none;
&:hover {
background: #000;
border-radius: 2rem;

&:hover, &:active {
color: $global-font-color;
background: $global-background-color;
cursor: pointer;
}
&:active {
background: #000;
outline: none;
}
&:focus, &:hover {

&:active, &:focus, &:hover {
outline: none;
}
span {
display: block;
overflow: hidden;
width: .875rem;
height: .75rem;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAKCAYAAACE2W/HAAAACXBIWXMAAArwAAAK8AFCrDSYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8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ynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKVJREFUeNqUz7ENgzAURdErUSXQMgdTZJFIqeg8DFI2YQeEvAEbUJja3y9NEiwCUXIlN/62jww7Saok3Z+r4pckXSRNWpskXb5deClHfeo7ylGrLqnbTmOMs/e+9d63McZ554GOlFLId0IIvXOuAUqgdM41IYQ+P5NSCpjZkitADRTZTwqgznUzWzCzZaMc9dbNbGEYhuuOclQB1OM43gBO/N/5MQAeMwpyB1MtLQAAAABJRU5ErkJggg==') no-repeat center center;
}

.dark-theme &{
border: 1px solid $global-border-color-dark;
.dark-theme & {
color: $global-font-secondary-color-dark;
background: $header-background-color-dark;
border-color: $global-border-color-dark;

&:hover, &:active {
color: $global-font-color-dark;
background: $global-background-color-dark;
}
}
}
4 changes: 2 additions & 2 deletions assets/css/_core/_media.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@media only screen and (max-width: 960px) {
#header-desktop {
.header-wrapper {
margin: 0 1rem;
padding: 0 1rem;
}
}

Expand All @@ -48,7 +48,7 @@
}
}

@media only screen and (max-width: 720px) {
@media only screen and (max-width: 680px) {
#header-desktop {
display: none;
}
Expand Down
9 changes: 3 additions & 6 deletions assets/css/_page/_single.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
color: $single-link-color;

.dark-theme & {
color: $single-link-color-dark;
color: $global-link-color-dark;
}

&:hover {
color: $single-link-hover-color;

.dark-theme & {
color: $single-link-hover-color-dark;
color: $global-link-hover-color-dark;
}
}
}
Expand Down Expand Up @@ -101,7 +101,6 @@

.dark-theme &:hover {
color: $single-link-hover-color-dark;
font-weight: bold;
}
}

Expand Down Expand Up @@ -179,12 +178,10 @@
min-width: 20%;
max-width: 80%;
display: inline-block;
padding: .625rem;
padding: .5rem;
margin: 0 auto;
border-bottom: 1px solid #d9d9d9;
font-size: .875rem;
color: #969696;
line-height: 1.7;
}

img {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/_partial/_archive/_tags.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
&:focus,
&:hover {
color: $global-link-hover-color;
transform: scale(1.1);
transform: scale(1.2);

.dark-theme & {
color: $global-link-hover-color-dark;
Expand Down
49 changes: 19 additions & 30 deletions assets/css/_partial/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,21 @@ header {
}

.header-title {
font-size: 1.5rem;
font-weight: bold;
}

.language-select {
font-weight: $global-font-weight;
border: none;
box-shadow: none;
background: transparent;
background-image: none;
-webkit-appearance: none;
color: $global-font-color;

.dark-theme & {
color: $global-font-color-dark;
}
.menu .menu-item {
position: relative;
}

&:focus {
outline: none;
}
.language-select {
position: absolute;
opacity: 0;
left: 0;
top: 0;
width: 100%;
height: 100%;

&:hover {
cursor: pointer;
Expand All @@ -47,23 +43,20 @@ header {
.header-wrapper {
width: auto;
text-align: center;
margin: 0 4rem;
padding: 0 3rem;
display: flex;
justify-content: space-between;

.header-title a {
padding: 0 8px;
font-size: 1.25rem;
.menu {
.menu-item {
margin: 0 .5rem;

i {
line-height: 2rem;
&.theme-switch {
margin: 0 .3rem;
}
}
}

.menu a {
padding: 0 8px;

&.active {
a.active {
font-weight: 900;
color: $header-hover-color;

Expand Down Expand Up @@ -96,10 +89,6 @@ header {
padding-left: 1rem;
box-sizing: border-box;

.header-title {
font-size: 1.25rem;
}

.menu-toggle {
cursor: pointer;
line-height: 4rem;
Expand Down
3 changes: 2 additions & 1 deletion assets/css/_partial/_single/_toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
display: block;
position: absolute;
width: 100%;
max-width: 1000px;
margin-left: 1000px;
padding: 0 .8rem;
border-left: 1px solid $global-border-color;
overflow-wrap: break-word;
box-sizing: border-box;
top: if($header-normal-mode-desktop, 7rem, 12rem);
top: if($header-normal-mode-desktop, 5rem, 10rem);

.dark-theme & {
border-left: 1px solid $global-border-color-dark;
Expand Down
8 changes: 4 additions & 4 deletions assets/css/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ $selection-color-dark: rgba(38, 139, 211, 0.3) !default;

// ========== Header ========== //
// Height of the header
$header-height-desktop: 4rem !default;
$header-height-mobile: 3.8rem !default;
$header-height-desktop: 3.5rem !default;
$header-height-mobile: 3.5rem !default;

// Color of the header background
$header-background-color: #f8f8f8 !default;
Expand All @@ -77,11 +77,11 @@ $toc-content-font-size: 0.9rem !default;

// Color of the single link
$single-link-color: #2d96bd !default;
$single-link-color-dark: #eee !default;
$single-link-color-dark: #55bde2 !default;

// Color of the hover single link
$single-link-hover-color: #ef3982 !default;
$single-link-hover-color-dark: #2d96bd !default;
$single-link-hover-color-dark: #bdebfc !default;

// Color of the table background
$table-background-color: #fff !default;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/theme.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/theme.min.js.map

Large diffs are not rendered by default.

35 changes: 28 additions & 7 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enableEmoji = true
# language code
languageCode = "en"
# website title
title = "LoveIt Theme"
title = "LoveIt"
# language name
languageName = "English"
# whether to include Chinese/Japanese/Korean
Expand Down Expand Up @@ -66,7 +66,7 @@ enableEmoji = true
[[languages.en.menu.main]]
identifier = "documentation"
pre = ""
name = "Documentation"
name = "Docs"
url = "/categories/documentation/"
title = ""
weight = 4
Expand All @@ -77,6 +77,13 @@ enableEmoji = true
url = "/about/"
title = ""
weight = 5
[[languages.en.menu.main]]
identifier = "github"
pre = "<i class='fab fa-github fa-fw'></i>"
name = ""
url = "https://github.com/dillonzq/LoveIt"
title = "GitHub"
weight = 6
[languages.en.params]
# site description
description = "About LoveIt Theme"
Expand Down Expand Up @@ -242,7 +249,7 @@ enableEmoji = true
# 网站语言, 仅在这里 CN 大写
languageCode = "zh-CN"
# 网站标题
title = "LoveIt 主题"
title = "LoveIt"
# 语言名称
languageName = "简体中文"
# 是否包括中日韩文字
Expand All @@ -260,7 +267,7 @@ enableEmoji = true
[[languages.zh-cn.menu.main]]
identifier = "posts"
pre = ""
name = "文章"
name = "所有文章"
url = "/posts/"
title = ""
weight = 1
Expand All @@ -281,7 +288,7 @@ enableEmoji = true
[[languages.zh-cn.menu.main]]
identifier = "documentation"
pre = ""
name = "主题文档"
name = "文档"
url = "/categories/documentation/"
title = ""
weight = 4
Expand All @@ -292,6 +299,13 @@ enableEmoji = true
url = "/about/"
title = ""
weight = 5
[[languages.zh-cn.menu.main]]
identifier = "github"
pre = "<i class='fab fa-github fa-fw'></i>"
name = ""
url = "https://github.com/dillonzq/LoveIt"
title = "GitHub"
weight = 6
[languages.zh-cn.params]
# 网站描述
description = "关于 LoveIt 主题"
Expand Down Expand Up @@ -457,7 +471,7 @@ enableEmoji = true
# language code
languageCode = "fr"
# website title
title = "LoveIt Thème"
title = "LoveIt"
# language name
languageName = "Français"
# whether to include Chinese/Japanese/Korean
Expand Down Expand Up @@ -496,7 +510,7 @@ enableEmoji = true
[[languages.fr.menu.main]]
identifier = "documentation"
pre = ""
name = "Documentation"
name = "Docs"
url = "/categories/documentation/"
title = ""
weight = 4
Expand All @@ -507,6 +521,13 @@ enableEmoji = true
url = "/about/"
title = ""
weight = 5
[[languages.fr.menu.main]]
identifier = "github"
pre = "<i class='fab fa-github fa-fw'></i>"
name = ""
url = "https://github.com/dillonzq/LoveIt"
title = "GitHub"
weight = 6
[languages.fr.params]
# site description
description = "À propos du thème LoveIt"
Expand Down
4 changes: 4 additions & 0 deletions exampleSite/content/categories/documentation/_index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Documentation"
slug: "documentation"
---
4 changes: 4 additions & 0 deletions exampleSite/content/categories/documentation/_index.fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Documentation"
slug: "documentation"
---
4 changes: 4 additions & 0 deletions exampleSite/content/categories/documentation/_index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "文档"
slug: "documentation"
---
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

{{- /* Dynamic to top button */ -}}
<a href="#" class="dynamic-to-top animated faster" id="dynamic-to-top">
<span>&nbsp;</span>
<i class="fas fa-chevron-up fa-fw"></i>
</a>

{{- /* Load JavaScript scripts and CSS */ -}}
Expand Down
Loading

0 comments on commit 3d9aad3

Please sign in to comment.