Optimized responsive layout.

This commit is contained in:
Cotes Chung 2020-06-07 00:42:21 +08:00
parent 34d54f9349
commit ba47cc0509
3 changed files with 88 additions and 81 deletions

View file

@ -45,7 +45,7 @@
or item.name == page.tab_active or item.name == page.tab_active
or item.name == "Home" and page.layout == "home" %}active{% endif %}"> or item.name == "Home" and page.layout == "home" %}active{% endif %}">
<a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100"> <a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100">
<i class="fa-fw {{ item.icon }} ml-3 mr-3 unloaded"></i> <i class="fa-fw {{ item.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
<span>{{ item.name | upcase }}</span> <span>{{ item.name | upcase }}</span>
</a> </a>
</li> <!-- .nav-item --> </li> <!-- .nav-item -->

View file

@ -53,7 +53,7 @@ layout: page
{% for post in posts %} {% for post in posts %}
<div class="post-preview"> <div class="post-preview">
<div class="d-flex justify-content-between align-items-center pr-2"> <div class="d-flex justify-content-between align-items-center pr-xl-2">
<h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1> <h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1>
{% if post.pin %} {% if post.pin %}
<i class="fas fa-thumbtack fa-fw fa-sm text-muted pinned" data-toggle="tooltip" data-placement="top" <i class="fas fa-thumbtack fa-fw fa-sm text-muted pinned" data-toggle="tooltip" data-placement="top"

View file

@ -11,36 +11,33 @@
#post-list { #post-list {
margin-top: 1rem; margin-top: 1rem;
padding-right: .5rem; padding-right: .5rem;
.post-meta {
i:not(:first-child) { // post-meta icons on HOME
margin-left: 1.5rem;
}
}
}
.pagination {
font-size: 1rem;
a:hover {
text-decoration: none;
}
}
.post-preview { .post-preview {
padding-top: 1.5rem; padding-top: 1.5rem;
padding-bottom: 1rem; padding-bottom: 1rem;
border-bottom: 1px solid var(--main-border-color); border-bottom: 1px solid var(--main-border-color);
h1 { h1 {
font-size: 1.4rem; font-size: 1.4rem;
margin: 0; margin: 0;
} }
i.far { /* fontawesome icons */ i.far { /* fontawesome icons */
font-size: 86%; font-size: 86%;
} }
.post-meta {
i:not(:first-child) { // post-meta icons on the homepage
margin-left: 1.5rem;
}
}
.post-content { .post-content {
margin-top: .6rem; margin-top: .6rem;
margin-bottom: .6rem; margin-bottom: .6rem;
color: var(--post-list-text-color); color: var(--post-list-text-color);
>p { /* Make preview shorter in Home page*/ >p {
/* Make preview shorter on the homepage */
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -49,9 +46,19 @@
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
} }
.pinned { .pinned {
transform: rotate(45deg); transform: rotate(45deg);
} }
} // .post-preview
} // #post-list
.pagination {
font-size: 1rem;
a:hover {
text-decoration: none;
} }
.page-item { .page-item {
@ -93,11 +100,11 @@
border-radius: 50%; border-radius: 50%;
} }
&:not(:last-child) { &:not(:last-child) {
margin-right: 0.6rem; margin-right: 0.7rem;
} }
} // .page-item } // .page-item
} // .pagination
@media all and (max-width: 576px) { @media all and (max-width: 576px) {
#post-list .post-meta>span i:not(:first-child) { #post-list .post-meta>span i:not(:first-child) {
@ -121,14 +128,14 @@
.pagination { .pagination {
font-size: .85rem; font-size: .85rem;
}
.page-item .page-link { .page-item .page-link {
width: 2.2rem; width: 2.2rem;
height: 2.2rem; height: 2.2rem;
} }
} }
}
/* Pannel hidden */ /* Pannel hidden */
@media all and (max-width: 1200px) { @media all and (max-width: 1200px) {
#post-list { #post-list {