Setting arrow color on hover #9
-
Hi, I wondering if there is a way to set the color of the arrow (inside the the ScrollToTop component) during mouse hover? I can see 'color' can be passed as a property to set the color and I have tried in CSS (via :hover on the class of the ScrollToTop component) but can't get that to work. |
Beta Was this translation helpful? Give feedback.
Answered by
HermanNygaard
Jan 14, 2021
Replies: 1 comment 1 reply
-
Hi! You can do it like this: JSX: <ScrollToTop smooth className="scrollButton" /> And in your CSS Stylesheet: .scrollButton {
/* Edit this to your liking, this is just the base stylesheet used in this component */
background-color: white;
right: 40px;
bottom: 40px;
position: fixed;
z-index: 2;
cursor: pointer;
border-radius: 7px;
width: 40px;
height: 40px;
transition: opacity 1s ease-in-out;
box-shadow: 0 9px 25px 0 rgba(132, 128, 177, 0.28);
border: none;
outline: none;
}
.scrollButton:hover svg {
/* Change color of arrow on hover :) */
fill: red
} Let me know if it works for you :) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
patrivet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! You can do it like this:
JSX:
And in your CSS Stylesheet:
Let me know if it works for you :)