Skip to content

Commit cbd4b10

Browse files
committed
Improved the compatibility in Firefox.
1 parent 08f8bb8 commit cbd4b10

2 files changed

Lines changed: 39 additions & 34 deletions

File tree

_includes/sidebar.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
</li> <!-- .nav-item -->
4444
{% endfor %}
4545

46-
<span class="cursor"></span>
4746
</ul> <!-- ul.nav.flex-column -->
4847

4948
</div><!-- #nav-wrap -->

assets/css/_src/main.scss

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*!
32
* The main styles.
43
* © 2018-2019 Cotes Chung
@@ -7,6 +6,7 @@
76

87
html, body {
98
height: 100%;
9+
font-size: 16px;
1010
}
1111

1212
/* Solved jumping scrollbar */
@@ -46,7 +46,6 @@ body {
4646

4747
#sidebar .nav-item {
4848
height: 20%;
49-
padding: 0 2rem;
5049
}
5150

5251
#sidebar .nav-link {
@@ -70,47 +69,53 @@ body {
7069
display: -ms-flexbox;
7170
}
7271

73-
.cursor {
74-
background: #fcfcfc;
75-
position: relative;
76-
display: none;
77-
top: 0;
78-
left: 98.5%;
79-
width: 3px;
80-
height: 10%;
81-
-webkit-transition: top 0.5s ease;
82-
-moz-transition: top 0.5s ease;
83-
transition: top 0.5s ease;
72+
#sidebar ul > li.active:nth-child(1) ~ li:last-child::after,
73+
#sidebar ul > li.nav-item:nth-child(1):hover ~ li:last-child::after {
74+
top: calc(-400% + (26px / 2));
75+
visibility: visible;
8476
}
8577

86-
#sidebar ul>li.active:nth-child(1)~.cursor,
87-
#sidebar ul>li.nav-item:nth-child(1):hover~.cursor {
88-
top: -95%;
89-
display: block;
78+
#sidebar ul > li.active:nth-child(2) ~ li:last-child::after,
79+
#sidebar ul > li.nav-item:nth-child(2):hover ~ li:last-child::after {
80+
top: calc(-300% + (26px / 2));
81+
visibility: visible;
9082
}
9183

92-
#sidebar ul>li.active:nth-child(2)~.cursor,
93-
#sidebar ul>li.nav-item:nth-child(2):hover~.cursor {
94-
top: -75%;
95-
display: block;
84+
#sidebar ul > li.active:nth-child(3) ~ li:last-child::after,
85+
#sidebar ul > li.nav-item:nth-child(3):hover ~ li:last-child::after {
86+
top: calc(-200% + (26px / 2));
87+
visibility: visible;
9688
}
9789

98-
#sidebar ul>li.active:nth-child(3)~.cursor,
99-
#sidebar ul>li.nav-item:nth-child(3):hover~.cursor {
100-
top: -55%;
101-
display: block;
90+
#sidebar ul > li.active:nth-child(4) ~ li:last-child::after,
91+
#sidebar ul > li.nav-item:nth-child(4):hover ~ li:last-child::after {
92+
top: calc(-100% + (26px / 2));
93+
visibility: visible;
10294
}
10395

104-
#sidebar ul>li.active:nth-child(4)~.cursor,
105-
#sidebar ul>li.nav-item:nth-child(4):hover~.cursor {
106-
top: -35%;
107-
display: block;
96+
#sidebar ul > li.active:nth-child(5):last-child::after,
97+
#sidebar ul > li.nav-item:nth-child(5):last-child:hover::after {
98+
top: calc(26px / 2);
99+
visibility: visible;
108100
}
109101

110-
#sidebar ul>li.active:nth-child(5)~.cursor,
111-
#sidebar ul>li.nav-item:nth-child(5):hover~.cursor {
112-
top: -15%;
113-
display: block;
102+
#sidebar ul > li:last-child > a {
103+
margin-right: -3px;
104+
max-width: calc(100% - 3px);
105+
}
106+
107+
#sidebar ul > li:last-child::after {
108+
visibility: hidden;
109+
content: "";
110+
position: relative;
111+
width: 3px;
112+
height: 26px;
113+
background: #fcfcfc;;
114+
pointer-events: none;
115+
-webkit-transition: top .5s ease;
116+
-moz-transition: top .5s ease;
117+
-o-transition: top .5s ease;
118+
transition: top .5s ease;
114119
}
115120

116121
#nav-wrap {
@@ -996,6 +1001,7 @@ a.tag:hover {
9961001
}
9971002

9981003
#archives .date {
1004+
white-space: nowrap;
9991005
display: inline-block;
10001006
}
10011007

0 commit comments

Comments
 (0)