Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Will there ever be “media queries” for individual elements Re: Will there ever be “media queries” for individual elements

#108259

Yeah, I see your point, but there must be a need for this otherwise people wouldn’t have come up with elaborate Javascript solutions for it.

If you look at something like ExtjS/Sencha then every element which is a widget has an observable event on it when it changes size so that layout changes can be made. It’s a common requirement for example to make a menu collapse when it doesn’t have enough room and this is solved by constantly listening to size change events on it’s container.

It just seems to me that the same could be achieved using conditional CSS, based on the size of an element. Personally I can think of a number of times when this would have been useful for me.