Skip to content

Commit 6f8c965

Browse files
committed
Fixed the posts' layout jumping in loading.
screen width >= 1200px and the panel is visible.
1 parent 9e6e41f commit 6f8c965

4 files changed

Lines changed: 50 additions & 18 deletions

File tree

_layouts/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# MIT License
66
---
77

8-
<div class="row d-flex justify-content-center bg-white">
8+
<div class="row bg-white">
99
<div class="col-12 col-lg-11 col-xl-8">
1010
<div id="page" class="post pb-5 pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4 pl-xl-3">
1111
{% if page.dynamic_title %}

_layouts/post.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# MIT Licensed
66
---
77

8-
<div class="row d-flex justify-content-center bg-white">
8+
<div class="row bg-white">
99
{% include date-format.html %}
1010

1111
<div id="post-wrap" class="col-12 col-lg-11 col-xl-8">
12-
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4 pl-xl-3">
12+
<div class="post pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
1313
<h1 data-toc-skip>{{ page.title }}</h1>
1414
<div class="post-meta text-muted d-flex flex-column">
1515
<!-- Published Date and Categoreis -->
@@ -82,10 +82,10 @@ <h1 data-toc-skip>{{ page.title }}</h1>
8282

8383
</div> <!-- .row -->
8484

85-
<div class="row d-flex justify-content-center bg-white">
85+
<div class="row bg-white">
8686
<div id="post-extend-wrap" class="col-12 col-lg-11 col-xl-8">
8787

88-
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4 pl-xl-3">
88+
<div class="pl-1 pr-1 pl-sm-2 pr-sm-2 pl-md-4 pr-md-4">
8989
{% include related-posts.html %}
9090

9191
<div class="post-pager d-flex justify-content-between">

assets/css/main.scss

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
10261026
}
10271027

10281028
/* Compact icons in sidebar & TOC hidden */
1029-
@media all and (min-width: 832px) and (max-width: 1200px) {
1029+
@media all and (min-width: 832px) and (max-width: 1199px) {
10301030

10311031
#sidebar {
10321032
width: 210px;
@@ -1070,37 +1070,39 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
10701070
}
10711071

10721072
/* Pannel hidden */
1073-
@media all and (max-width: 1200px) {
1073+
@media all and (max-width: 1199px) {
10741074
#panel-wrap {
10751075
display: none;
10761076
}
10771077

10781078
#topbar-main {
10791079
padding: 0;
10801080
}
1081+
1082+
#main>div.row {
1083+
-webkit-box-pack: center!important;
1084+
-ms-flex-pack: center!important;
1085+
justify-content: center!important;
1086+
}
10811087
}
10821088

10831089

10841090
/*--- desktop mode, both sidebar and panel are visible ---*/
10851091

1086-
@media all and (min-width: 1201px) {
1092+
@media all and (min-width: 1200px) {
10871093

10881094
#main>div.row>div.col-xl-8 {
10891095
-webkit-box-flex: 0;
10901096
-ms-flex: 0 0 75%;
10911097
flex: 0 0 75%;
1092-
max-width: 850px;
1098+
max-width: 75%;
10931099
padding-left: 3%;
10941100
}
10951101

10961102
#panel-wrap {
10971103
max-width: 300px;
10981104
}
10991105

1100-
#breadcrumb {
1101-
padding-left: 0;
1102-
}
1103-
11041106
#topbar-main {
11051107
padding: 0 calc((100% - 1150px) / 2)!important;
11061108
}
@@ -1123,12 +1125,31 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
11231125

11241126
}
11251127

1126-
@media all and (min-width: 1650px) {
1128+
@media all and (min-width: 1400px) {
1129+
1130+
#main>div.row {
1131+
padding-left: calc((100% - 1150px) / 2);
1132+
}
11271133

11281134
#main>div.row>div.col-xl-8 {
1129-
padding-left: 0px;
11301135
max-width: 850px;
11311136
}
1137+
}
1138+
1139+
@media all and (min-width: 1650px) {
1140+
1141+
#breadcrumb {
1142+
padding-left: 0;
1143+
}
1144+
1145+
#main>div.row>div.col-xl-8 {
1146+
padding-left: 0;
1147+
}
1148+
1149+
#main>div.row>div.col-xl-8>div:first-child {
1150+
padding-left: .55rem !important;
1151+
padding-right: 1.9rem !important;
1152+
}
11321153

11331154
#main-wrap {
11341155
margin-left: 350px;
@@ -1260,11 +1281,11 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
12601281
}
12611282

12621283
#main>div.row {
1263-
padding-right: calc(100% - 1570px); /* 100% - (1920px - 350px) */
1284+
padding-left: calc((100% - 1150px - 2%) / 2);
12641285
}
12651286

12661287
#panel-wrap {
1267-
margin-left: calc((100% - 1150px) / 8);
1288+
margin-left: 3%;
12681289
}
12691290

12701291
footer {
@@ -1279,4 +1300,15 @@ div.tooltip-inner { /* Overrided BS4 Tooltip */
12791300
right: calc(100% - 1920px + 15rem);
12801301
}
12811302

1303+
}
1304+
1305+
1306+
@media (min-width: 1920px) {
1307+
#main>div.row {
1308+
padding-left: 190px;
1309+
}
1310+
1311+
#panel-wrap {
1312+
margin-left: 41px;
1313+
}
12821314
}

assets/css/post.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
/*
116116
The following resposive design aim to make #post-extend-wrap margin-right same as pannel's width
117117
*/
118-
@media all and (min-width: 1201px) {
118+
@media all and (min-width: 1200px) {
119119
#post-extend-wrap {
120120
margin-right: 25%;
121121
}

0 commit comments

Comments
 (0)