Skip to content

Commit 5a7fef9

Browse files
authored
Remove :hover pseudo-class from link-style-hover mixin (#1792)
1 parent 779c3e0 commit 5a7fef9

File tree

6 files changed

+19
-20
lines changed

6 files changed

+19
-20
lines changed

src/pydata_sphinx_theme/assets/styles/abstracts/_links.scss

+5-6
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ $link-hover-decoration-thickness: unquote("max(3px, .1875rem, .12em)") !default;
4949
}
5050

5151
// Simple hover style - can be used alone or in conjunction with other mixins
52-
// Add the text underline and change in thickness on hover
52+
// Add the text underline and change in thickness on hover.
53+
// Intended for use with the `:hover` pseudo-class.
5354
@mixin link-style-hover {
54-
&:hover {
55-
@include link-decoration;
56-
@include link-decoration-hover;
57-
color: var(--pst-color-link-hover);
58-
}
55+
@include link-decoration;
56+
@include link-decoration-hover;
57+
color: var(--pst-color-link-hover);
5958
}
6059

6160
// Default link styles

src/pydata_sphinx_theme/assets/styles/base/_base.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ pre {
185185
margin-inline-end: 0.5em;
186186
}
187187

188-
@include link-style-hover;
189188
&:hover {
189+
@include link-style-hover;
190190
text-decoration-thickness: 1px;
191191
background-color: var(--pst-violet-600);
192192
color: var(--pst-color-secondary-text);

src/pydata_sphinx_theme/assets/styles/components/_prev-next.scss

+4-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,10 @@
3030
font-size: 1.1em;
3131
}
3232

33-
&:hover p.prev-next-title {
34-
@include link-style-hover;
35-
}
36-
// Exception here - keep visited in the default link colour
37-
// it still should hover on the default link hover colour
38-
&:visited p.prev-next-title {
39-
color: var(--pst-color-link);
40-
&:hover {
41-
color: var(--pst-color-link-hover);
33+
&:hover,
34+
&:visited:hover {
35+
p.prev-next-title {
36+
@include link-style-hover;
4237
}
4338
}
4439

src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ button.btn.version-switcher__button {
3131
&:not(:last-child) {
3232
border-bottom: 1px solid var(--pst-color-border);
3333
}
34-
@include link-style-hover;
3534
&:hover {
35+
@include link-style-hover;
3636
background-color: var(--pst-color-surface);
3737
}
3838
&.active {

src/pydata_sphinx_theme/assets/styles/extensions/_sphinx_design.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ html {
314314
min-width: 2.25rem;
315315
padding: 0.3125rem 0.75rem 0.4375rem; // 5px 12px 7px
316316

317-
@include link-style-hover; // override Sphinx Design
318317
&:hover {
318+
@include link-style-hover; // override Sphinx Design
319319
text-decoration-thickness: 1px;
320320
}
321321
}

src/pydata_sphinx_theme/assets/styles/sections/_header.scss

+7-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@
110110
button {
111111
display: unset;
112112
border: none;
113-
@include link-style-hover;
113+
114+
&:hover {
115+
@include link-style-hover;
116+
}
114117
}
115118

116119
.dropdown-menu {
@@ -154,7 +157,9 @@
154157
}
155158

156159
.nav-link {
157-
@include link-style-hover;
160+
&:hover {
161+
@include link-style-hover;
162+
}
158163

159164
// Override Bootstrap
160165
transition: none;

0 commit comments

Comments
 (0)