Skip to content

Commit eaa01ec

Browse files
committed
adjust anchor transition to make it feel more responsive (reduce transition time so icon doesn't linger after cursor is removed, use color transitions to give fade/highlight effect, retain visibility transition for screen readers)
1 parent 65ae433 commit eaa01ec

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

_sass/kroxylicious.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,16 @@ div.highlighter-rouge {
136136

137137
h2>a.anchor, h3>a.anchor, h4>a.anchor, h5>a.anchor, h6>a.anchor {
138138
font-family: bootstrap-icons!important;
139+
color: rgba($primary, 0);
139140
display: block;
140141
margin-left: -1.5ex;
141142
position: absolute;
142143
text-decoration: none !important;
143144
visibility: hidden;
144145
z-index: 2;
145-
transition: visibility 1s;
146+
transition:
147+
visibility 1ms linear,
148+
color 200ms ease-in-out;
146149
}
147150

148151
h2>a.anchor::before, h3>a.anchor::before, h4>a.anchor::before, h5>a.anchor::before, h6>a.anchor::before {
@@ -151,4 +154,9 @@ h2>a.anchor::before, h3>a.anchor::before, h4>a.anchor::before, h5>a.anchor::befo
151154

152155
h2:hover>a.anchor, h3:hover>a.anchor, h4:hover>a.anchor, h5:hover>a.anchor, h6:hover>a.anchor {
153156
visibility: visible;
157+
color: rgba($primary, 1);
158+
}
159+
160+
h2:hover>a.anchor:hover, h3:hover>a.anchor:hover, h4:hover>a.anchor:hover, h5:hover>a.anchor:hover, h6:hover>a.anchor:hover {
161+
color: rgba($secondary, 1);
154162
}

0 commit comments

Comments
 (0)