Mendix styling

0
I just got the koala to work so that my styling in custom.scss file works. So i currently have a button (link) on an image. - When i hover over the image the image darkens. - When I hover over the link-button the styling also changes but the hover-styling of the image dissapears.  What I want: When you hover over the image, the image darkens (done!) When I hover over the button, the buttons-style changes as well as keeping the image dark. Any ideas? I hope this doesn’t take to much effort since im new to styling in mendix.
asked
2 answers
1

This should be possible by using the Adjacent sibling combinator in CSS. When the image is a direct sibling of the button, you could do something like below.
 

.image:hover,
.btn:hover + .image {
  // Darken image
}

.btn:hover {
  background-color: green;
}

 

This is a simplified example. I recommend to use custom class names for your use case.

 

answered
0

I don't think this is an easy job, because these are seperate html elements. What is the reason the image darkens and there's a button on top of the image which should also darken? If you want to make the image clickable you could place it in a container and set an On Click action on the container. Connect the On Click action from your current button to the container. Now the user can click the image. Or is this not what you want to achieve?

answered