Skip to content

Commit b84444d

Browse files
committed
Improved the responsive of sidebar bottom.
1 parent 1b87ee2 commit b84444d

2 files changed

Lines changed: 64 additions & 52 deletions

File tree

_includes/sidebar.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@
5555

5656
</div><!-- #nav-wrapper -->
5757

58-
<div class="sidebar-bottom d-flex justify-content-around mt-4">
58+
<div class="sidebar-bottom d-flex flex-wrap justify-content-around mt-4">
5959

6060
{% if site.theme_mode == "dual" %}
6161
<span id="mode-toggle-wrapper">
6262
{% include mode-toggle.html %}
6363
</span>
64+
<span class="icon-border"></span>
6465
{% endif %}
6566

6667
<a href="https://github.com/{{ site.github.username }}" target="_blank">

assets/css/main.scss

Lines changed: 62 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
color: rgba(255, 255, 255, 0.5);
1616
transition: color 0.35s ease-in-out;
1717
user-select: none;
18+
margin: 0 .25rem;
1819
}
1920

2021
@mixin icon-round($diameter) {
@@ -65,6 +66,10 @@ body {
6566
@include sidebar-icon;
6667
}
6768

69+
#sidebar .sidebar-bottom .icon-border+a { // the icon behide mode-toggle
70+
margin-left: .1rem;
71+
}
72+
6873
#sidebar .nav-item {
6974
height: 20%;
7075
}
@@ -234,35 +239,38 @@ body {
234239
margin-top: 2rem;
235240
}
236241

237-
.sidebar-bottom {
242+
243+
#sidebar .sidebar-bottom {
238244
font-size: 1.2rem;
239-
margin: 2rem 2.5rem;
240-
flex-shrink: 0;
241-
-webkit-flex-shrink: 0;
242-
-ms-flex-shrink: 0;
243-
/*box-shadow: inset 0 0 0.25em 0 rgba(0, 0, 0, 0.22);*/
244-
}
245+
margin: 2rem 2.5rem 1.6rem;
245246

246-
#sidebar .sidebar-bottom a:hover,
247-
#sidebar #mode-toggle-wrapper:hover {
248-
color: #fff;
249-
}
247+
a {
248+
margin-bottom: .5rem; // icons may have multi lines
249+
}
250250

251-
#mode-toggle-wrapper {
252-
@include sidebar-icon;
253-
font-size: 1.05rem;
254-
text-align: center;
255-
}
251+
a:hover, #mode-toggle-wrapper>i:hover {
252+
color: #fff;
253+
}
256254

257-
#mode-toggle-wrapper::after {
258-
content: "";
259-
background: #525354;
260-
width: 1px;
261-
height: 8px;
262-
margin-left: 7px;
263-
margin-right: -6px;
264-
margin-bottom: 3px;
265-
display: inline-block;
255+
#mode-toggle-wrapper {
256+
i {
257+
@include sidebar-icon;
258+
margin-right: 0;
259+
font-size: 1.05rem;
260+
text-align: center;
261+
position: relative;
262+
bottom: 1px;
263+
}
264+
}
265+
266+
.icon-border {
267+
background: #525354;
268+
width: 1px;
269+
height: 8px;
270+
margin-top: .6rem;
271+
margin-left: .25rem;
272+
margin-right: .25rem;
273+
}
266274
}
267275

268276

@@ -1154,12 +1162,10 @@ table tbody td {
11541162
margin-right: 1rem;
11551163
}
11561164

1157-
.sidebar-bottom a {
1158-
padding: 0 0.6rem;
1159-
}
1165+
#sidebar .sidebar-bottom {
1166+
margin-left: 1.5rem;
1167+
margin-right: 1.5rem;
11601168

1161-
#mode-toggle-wrapper {
1162-
padding-left: 1.2rem;
11631169
}
11641170

11651171
#main-wrapper {
@@ -1392,27 +1398,23 @@ table tbody td {
13921398
display: inline-block!important;
13931399
}
13941400

1395-
.sidebar-bottom {
1401+
#sidebar .sidebar-bottom {
13961402
margin-left: 3.5rem;
13971403
margin-right: 3rem;
13981404
font-size: 1.3rem;
1399-
padding-bottom: 1rem;
1400-
}
1401-
1402-
.sidebar-bottom a {
1403-
border: 1px solid;
1404-
border-radius: 50%;
1405-
font-size: 1rem;
1406-
width: 2rem;
1407-
height: 2rem;
1408-
text-align: center;
1409-
}
1410-
1411-
.sidebar-bottom a>i {
1412-
text-align: center;
1413-
width: 1.25em;
1414-
padding-top: .45rem;
1415-
}
1405+
a {
1406+
border: 1px solid;
1407+
border-radius: 50%;
1408+
font-size: 1rem;
1409+
width: 2rem;
1410+
height: 2rem;
1411+
text-align: center;
1412+
i {
1413+
text-align: center;
1414+
width: 1.25em;
1415+
padding-top: .45rem;
1416+
}
1417+
}
14161418

14171419
#mode-toggle-wrapper {
14181420
font-size: .9rem;
@@ -1421,13 +1423,22 @@ table tbody td {
14211423
#mode-toggle-wrapper>i {
14221424
@include icon-round(2rem);
14231425
padding-top: 0.5rem;
1426+
bottom: 0;
14241427
}
14251428

1426-
#mode-toggle-wrapper::after {
1427-
height: 14px;
1428-
margin-bottom: 0;
1429+
.icon-border {
1430+
height: 14px;
1431+
margin-left: .2rem;
1432+
margin-right: .2rem;
1433+
margin-bottom: 0;
1434+
}
1435+
1436+
.icon-border+a {
1437+
margin-left: 0;
1438+
}
14291439
}
14301440

1441+
14311442
footer>div.d-flex {
14321443
max-width: 1150px;
14331444
}

0 commit comments

Comments
 (0)