From ba47cc05091fcac463c9fbb8fca2a89e40561091 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 7 Jun 2020 00:42:21 +0800 Subject: [PATCH] Optimized responsive layout. --- _includes/sidebar.html | 2 +- _layouts/home.html | 2 +- assets/css/home.scss | 165 +++++++++++++++++++++-------------------- 3 files changed, 88 insertions(+), 81 deletions(-) diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 94d84ab..fb7421a 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -45,7 +45,7 @@ or item.name == page.tab_active or item.name == "Home" and page.layout == "home" %}active{% endif %}"> - + {{ item.name | upcase }} diff --git a/_layouts/home.html b/_layouts/home.html index 891764f..2fc465b 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -53,7 +53,7 @@ layout: page {% for post in posts %}
-
+

{{ post.title }}

{% if post.pin %} p { + /* Make preview shorter on the homepage */ + margin: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + } + + .pinned { + transform: rotate(45deg); + } + + } // .post-preview + +} // #post-list .pagination { font-size: 1rem; a:hover { text-decoration: none; } -} -.post-preview { - padding-top: 1.5rem; - padding-bottom: 1rem; - border-bottom: 1px solid var(--main-border-color); - h1 { - font-size: 1.4rem; - margin: 0; - } - i.far { /* fontawesome icons */ - font-size: 86%; - } - .post-content { - margin-top: .6rem; - margin-bottom: .6rem; - color: var(--post-list-text-color); - >p { /* Make preview shorter in Home page*/ - margin: 0; - overflow: hidden; - text-overflow: ellipsis; + .page-item { + .page-link { + color: var(--btn-patinator-text-color); + width: 2.5rem; + height: 2.5rem; + padding: 0; + text-align: center; display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - } - } - .pinned { - transform: rotate(45deg); - } -} - -.page-item { - .page-link { - color: var(--btn-patinator-text-color); - width: 2.5rem; - height: 2.5rem; - padding: 0; - text-align: center; - display: -webkit-box; - display: flex; - -webkit-box-pack: center; - justify-content: center; - -webkit-box-align: center; - align-items: center; - border-radius: 50%; - border: 1px solid var(--btn-paginator-border-color); - font-family: 'Lato', sans-serif; - background-color: var(--button-bg); - } - &.active { - .page-link { - background-color: var(--btn-active-bg); - border-color: var(--btn-active-border-color); - box-shadow: 0 0 8px 0 var(--btn-paginator-shadow) !important; - color: var(--btn-text-color); - } - } - &.disabled { - cursor: not-allowed; - .page-link { - color: rgba(108, 117, 125, 0.57); - border-color: var(--btn-paginator-border-color); + display: flex; + -webkit-box-pack: center; + justify-content: center; + -webkit-box-align: center; + align-items: center; + border-radius: 50%; + border: 1px solid var(--btn-paginator-border-color); + font-family: 'Lato', sans-serif; background-color: var(--button-bg); } - } - &:first-child .page-link, - &:last-child .page-link { - border-radius: 50%; - } - &:not(:last-child) { - margin-right: 0.6rem; - } - -} // .page-item + &.active { + .page-link { + background-color: var(--btn-active-bg); + border-color: var(--btn-active-border-color); + box-shadow: 0 0 8px 0 var(--btn-paginator-shadow) !important; + color: var(--btn-text-color); + } + } + &.disabled { + cursor: not-allowed; + .page-link { + color: rgba(108, 117, 125, 0.57); + border-color: var(--btn-paginator-border-color); + background-color: var(--button-bg); + } + } + &:first-child .page-link, + &:last-child .page-link { + border-radius: 50%; + } + &:not(:last-child) { + margin-right: 0.7rem; + } + } // .page-item +} // .pagination @media all and (max-width: 576px) { #post-list .post-meta>span i:not(:first-child) { @@ -121,12 +128,12 @@ .pagination { font-size: .85rem; + .page-item .page-link { + width: 2.2rem; + height: 2.2rem; + } } - .page-item .page-link { - width: 2.2rem; - height: 2.2rem; - } } /* Pannel hidden */