Skip to content

Commit

Permalink
Remove :hover pseudo-class from link-style-hover mixin (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou committed May 7, 2024
1 parent 779c3e0 commit 5a7fef9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
11 changes: 5 additions & 6 deletions src/pydata_sphinx_theme/assets/styles/abstracts/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ $link-hover-decoration-thickness: unquote("max(3px, .1875rem, .12em)") !default;
}

// Simple hover style - can be used alone or in conjunction with other mixins
// Add the text underline and change in thickness on hover
// Add the text underline and change in thickness on hover.
// Intended for use with the `:hover` pseudo-class.
@mixin link-style-hover {
&:hover {
@include link-decoration;
@include link-decoration-hover;
color: var(--pst-color-link-hover);
}
@include link-decoration;
@include link-decoration-hover;
color: var(--pst-color-link-hover);
}

// Default link styles
Expand Down
2 changes: 1 addition & 1 deletion src/pydata_sphinx_theme/assets/styles/base/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ pre {
margin-inline-end: 0.5em;
}

@include link-style-hover;
&:hover {
@include link-style-hover;
text-decoration-thickness: 1px;
background-color: var(--pst-violet-600);
color: var(--pst-color-secondary-text);
Expand Down
13 changes: 4 additions & 9 deletions src/pydata_sphinx_theme/assets/styles/components/_prev-next.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,10 @@
font-size: 1.1em;
}

&:hover p.prev-next-title {
@include link-style-hover;
}
// Exception here - keep visited in the default link colour
// it still should hover on the default link hover colour
&:visited p.prev-next-title {
color: var(--pst-color-link);
&:hover {
color: var(--pst-color-link-hover);
&:hover,
&:visited:hover {
p.prev-next-title {
@include link-style-hover;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ button.btn.version-switcher__button {
&:not(:last-child) {
border-bottom: 1px solid var(--pst-color-border);
}
@include link-style-hover;
&:hover {
@include link-style-hover;
background-color: var(--pst-color-surface);
}
&.active {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ html {
min-width: 2.25rem;
padding: 0.3125rem 0.75rem 0.4375rem; // 5px 12px 7px

@include link-style-hover; // override Sphinx Design
&:hover {
@include link-style-hover; // override Sphinx Design
text-decoration-thickness: 1px;
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/pydata_sphinx_theme/assets/styles/sections/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@
button {
display: unset;
border: none;
@include link-style-hover;

&:hover {
@include link-style-hover;
}
}

.dropdown-menu {
Expand Down Expand Up @@ -154,7 +157,9 @@
}

.nav-link {
@include link-style-hover;
&:hover {
@include link-style-hover;
}

// Override Bootstrap
transition: none;
Expand Down

0 comments on commit 5a7fef9

Please sign in to comment.