|
|
|
|
|
by onion2k
1881 days ago
|
|
There is a proposed feature in CSS called "container queries" that does exactly this - media queries on the parent container of an element. There are performance concerns and syntax concerns, but they probably will appear in stable versions of browsers in the nearish future. In the meantime you can enable a version of them in Chrome using a Chrome flag. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Contain... |
|