0

For design purpose, I need to change the background-color of a div when its child is bigger than it. The parent div has a fixed height:

height: calc(~'100% - 112px');
overflow-x: auto;
overflow-y: auto;

and the child has no height precised so it takes all the place it needs.

The children displays a grid, and when we reach the end of the grid the client believes there's still content that the site didn't load; we need to change the color so it's clear there no data anymore. Problem, the change of color is not nice looking when we do it even if there's not enough data.

As we use less, I was thinking about using a condition, where I could specify that if the height of the children is higher than the parent's height, the background-color is different. But it looks that what I want to do is not as easy as I thought.

Can I check if the overflow is shown to put my condition? Can I do that in pure CSS / Less or do I have to do it in js?

Thanks in advance for your answers :)

Lyzvaleska
  • 283
  • 6
  • 16

0 Answers0