title: Background SVG technique?
body: <p>To create background patterns (triangle, trapezoid, etc.) I see a lot of devs relying on SVGs. 
  Today, I came across a technique that I don't quite understand.</p>
  
  <p>By scaling a shape like this:</p>
  
  <p><a href="https://i.stack.imgur.com/fol6I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fol6I.png" alt="enter image description here"></a></p>
  
  <p>and applying <code>height: 100%</code> as well as <code>transform-origin</code> a triangle is created. The start-point of the triangle is always the lower-left corner of the containing element. The result is nice and responsive, but I have no idea why this works from a geometric perspective.</p>
  
  <p>I created a <a href="https://codepen.io/florianmartens/pen/JjYprWj" rel="nofollow noreferrer">Codepen</a> to demonstrate.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.shape {
    position: absolute;
    width: 100%;
  }
  
  .shape-img {
    padding-bottom: 10rem;
    overflow: hidden;
    background: yellow;
    position: inherit;
    width: inherit;
  
  }
  
  .shape-img &gt; svg {
    position: inherit;
    height: 100%;
    width: inherit;
    transform: scale(2);
    transform-origin: top center;
  }
  
  .position-relative {
    position: relative;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="position-relative"&gt;
        &lt;div class="shape"&gt;
          &lt;div class="shape shape-img"&gt;
            &lt;svg viewBox="0 0 100 50" preserveAspectRatio="none"&gt;&lt;path d="M0 25h25L75 0h25v50H0z" fill="currentColor"&gt;&lt;/path&gt;&lt;/svg&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;!-- 
  &lt;svg viewBox="0 0 100 50" preserveAspectRatio="none"&gt;&lt;path d="M0 25h25L75 0h25v50H0z" fill="currentColor"&gt;&lt;/path&gt;&lt;/svg&gt;
  --&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>1. How does this approach ensure that the lower-left corner the bottom of the containing element?</strong></p>
  
  <p><strong>2. How does this approach ensure that the user sees a triangle shape regardless of the screen-size?</strong></p>