Can we talk about how clip-path shapes went weird on me until I switched to percentages
Last week I spent about three hours building a little mountain range scene with pure CSS, all divs and clip-path polygons, and the peaks kept coming out lopsided no matter what numbers I put in. I was using pixel values like polygon(0 100%, 120px 0, 240px 100%) and they looked fine in my browser at full size, but the second I shrank the window the whole range turned into a jagged mess. Then I tried swapping every pixel value for a percentage of the element's own width and height, so it became polygon(0% 100%, 50% 0%, 100% 100%), and suddenly the peaks held their shape at every screen size. What I learned is that clip-path points are relative to each element, not the page, so pixels break the moment the box resizes but percentages ride along with it. I rebuilt the whole scene in maybe 20 minutes after that. The other thing that bit me was stacking order, because my sun kept hiding behind the mountains until I gave it a z-index. If you have messed with clip-path shapes for scenes like this, do you stick to percentages or do you recalc pixels with media queries?