-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove :hover pseudo-class from link-style-hover mixin #1792
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done self-reviewing
// 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of style rule exceptions isn't needed because:
- line 41 is incorporated in lines 34 and 36 on the right - the
link-style-hover
mixin (modified and shown above in this diff) sets color to--pst-color-link-hover
- line 39 is incorporated in lines 27 and 28 on the right - the link-style-default mixin sets color to --pst-color-link
&:hover { | ||
@include link-style-hover; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cody tidiness bonus: I like how this change allows everything to be lexically grouped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, it's definitely neater than my original approach!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this LGTM 🚀 merging now!
&:hover { | ||
@include link-style-hover; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, it's definitely neater than my original approach!
This PR:
Removing the pseudo-class from within the link-style-hover makes the mixin a bit more flexible. For example, I realized that I wanted to change the "next" and "previous" links in the footer so that when any part of the
a
element is hovered, the link text is underlined. It was complicated to do that with the pseudo-class in the mixin, but easy to do afterwards.Before:
After: