Skip to content

Commit 3888fb7

Browse files
committed
Optimized responsive layout.
1 parent a1a5d79 commit 3888fb7

File tree

3 files changed

+87
-80
lines changed

3 files changed

+87
-80
lines changed

_includes/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
or item.name == page.tab_active
4646
or item.name == "Home" and page.layout == "home" %}active{% endif %}">
4747
<a href="{{ ref }}" class="nav-link d-flex justify-content-center align-items-center w-100">
48-
<i class="fa-fw {{ item.icon }} ml-3 mr-3 unloaded"></i>
48+
<i class="fa-fw {{ item.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
4949
<span>{{ item.name | upcase }}</span>
5050
</a>
5151
</li> <!-- .nav-item -->

_layouts/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
{% for post in posts %}
5454

5555
<div class="post-preview">
56-
<div class="d-flex justify-content-between align-items-center pr-2">
56+
<div class="d-flex justify-content-between align-items-center pr-xl-2">
5757
<h1><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h1>
5858
{% if post.pin %}
5959
<i class="fas fa-thumbtack fa-fw fa-sm text-muted pinned" data-toggle="tooltip" data-placement="top"

assets/css/home.scss

Lines changed: 85 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -11,93 +11,100 @@
1111
#post-list {
1212
margin-top: 1rem;
1313
padding-right: .5rem;
14-
.post-meta {
15-
i:not(:first-child) { // post-meta icons on HOME
16-
margin-left: 1.5rem;
14+
15+
.post-preview {
16+
padding-top: 1.5rem;
17+
padding-bottom: 1rem;
18+
border-bottom: 1px solid var(--main-border-color);
19+
20+
h1 {
21+
font-size: 1.4rem;
22+
margin: 0;
1723
}
18-
}
19-
}
24+
25+
i.far { /* fontawesome icons */
26+
font-size: 86%;
27+
}
28+
29+
.post-meta {
30+
i:not(:first-child) { // post-meta icons on the homepage
31+
margin-left: 1.5rem;
32+
}
33+
}
34+
35+
.post-content {
36+
margin-top: .6rem;
37+
margin-bottom: .6rem;
38+
color: var(--post-list-text-color);
39+
>p {
40+
/* Make preview shorter on the homepage */
41+
margin: 0;
42+
overflow: hidden;
43+
text-overflow: ellipsis;
44+
display: -webkit-box;
45+
-webkit-line-clamp: 2;
46+
-webkit-box-orient: vertical;
47+
}
48+
}
49+
50+
.pinned {
51+
transform: rotate(45deg);
52+
}
53+
54+
} // .post-preview
55+
56+
} // #post-list
2057

2158
.pagination {
2259
font-size: 1rem;
2360
a:hover {
2461
text-decoration: none;
2562
}
26-
}
2763

28-
.post-preview {
29-
padding-top: 1.5rem;
30-
padding-bottom: 1rem;
31-
border-bottom: 1px solid var(--main-border-color);
32-
h1 {
33-
font-size: 1.4rem;
34-
margin: 0;
35-
}
36-
i.far { /* fontawesome icons */
37-
font-size: 86%;
38-
}
39-
.post-content {
40-
margin-top: .6rem;
41-
margin-bottom: .6rem;
42-
color: var(--post-list-text-color);
43-
>p { /* Make preview shorter in Home page*/
44-
margin: 0;
45-
overflow: hidden;
46-
text-overflow: ellipsis;
64+
.page-item {
65+
.page-link {
66+
color: var(--btn-patinator-text-color);
67+
width: 2.5rem;
68+
height: 2.5rem;
69+
padding: 0;
70+
text-align: center;
4771
display: -webkit-box;
48-
-webkit-line-clamp: 2;
49-
-webkit-box-orient: vertical;
72+
display: flex;
73+
-webkit-box-pack: center;
74+
justify-content: center;
75+
-webkit-box-align: center;
76+
align-items: center;
77+
border-radius: 50%;
78+
border: 1px solid var(--btn-paginator-border-color);
79+
font-family: 'Lato', sans-serif;
80+
background-color: var(--button-bg);
5081
}
51-
}
52-
.pinned {
53-
transform: rotate(45deg);
54-
}
55-
}
56-
57-
.page-item {
58-
.page-link {
59-
color: var(--btn-patinator-text-color);
60-
width: 2.5rem;
61-
height: 2.5rem;
62-
padding: 0;
63-
text-align: center;
64-
display: -webkit-box;
65-
display: flex;
66-
-webkit-box-pack: center;
67-
justify-content: center;
68-
-webkit-box-align: center;
69-
align-items: center;
70-
border-radius: 50%;
71-
border: 1px solid var(--btn-paginator-border-color);
72-
font-family: 'Lato', sans-serif;
73-
background-color: var(--button-bg);
74-
}
75-
&.active {
76-
.page-link {
77-
background-color: var(--btn-active-bg);
78-
border-color: var(--btn-active-border-color);
79-
box-shadow: 0 0 8px 0 var(--btn-paginator-shadow) !important;
80-
color: var(--btn-text-color);
82+
&.active {
83+
.page-link {
84+
background-color: var(--btn-active-bg);
85+
border-color: var(--btn-active-border-color);
86+
box-shadow: 0 0 8px 0 var(--btn-paginator-shadow) !important;
87+
color: var(--btn-text-color);
88+
}
8189
}
82-
}
83-
&.disabled {
84-
cursor: not-allowed;
85-
.page-link {
86-
color: rgba(108, 117, 125, 0.57);
87-
border-color: var(--btn-paginator-border-color);
88-
background-color: var(--button-bg);
90+
&.disabled {
91+
cursor: not-allowed;
92+
.page-link {
93+
color: rgba(108, 117, 125, 0.57);
94+
border-color: var(--btn-paginator-border-color);
95+
background-color: var(--button-bg);
96+
}
8997
}
90-
}
91-
&:first-child .page-link,
92-
&:last-child .page-link {
93-
border-radius: 50%;
94-
}
95-
&:not(:last-child) {
96-
margin-right: 0.6rem;
97-
}
98-
99-
} // .page-item
98+
&:first-child .page-link,
99+
&:last-child .page-link {
100+
border-radius: 50%;
101+
}
102+
&:not(:last-child) {
103+
margin-right: 0.7rem;
104+
}
105+
} // .page-item
100106

107+
} // .pagination
101108

102109
@media all and (max-width: 576px) {
103110
#post-list .post-meta>span i:not(:first-child) {
@@ -121,12 +128,12 @@
121128

122129
.pagination {
123130
font-size: .85rem;
131+
.page-item .page-link {
132+
width: 2.2rem;
133+
height: 2.2rem;
134+
}
124135
}
125136

126-
.page-item .page-link {
127-
width: 2.2rem;
128-
height: 2.2rem;
129-
}
130137
}
131138

132139
/* Pannel hidden */

0 commit comments

Comments
 (0)