6 ms·
But then it's responsive to the page size, not the container size. That's a small, but important difference. For instance, I recently made a component to be in
by maaaats 7y ago
But then it's responsive to the page size, not the container size. That's a small, but important difference.
For instance, I recently made a component to be included on other pages at work. It had to look good no matter the size the page gave it. So they might put it into a 400px wide container, on a 1600px wide page. If I used vw or media queries to draw it based on page size, it would behave wrong.
- SquareWheel 7y agoI was thinking about that problem earlier. Is there not a CSS unit for container size? If not, that seems like a very useful addition. Like a more embedded version of vw/vh.
- ZeikJT 7y agoPercent can be based on container depending on how the container size is set.
- SquareWheel 7y agoAh, of course you're right. Good point thank you.