title: Make border width responsive
body: <p>I've created a triangle overlay over an image using borders. </p>
  
  <p>HTML and CSS</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.hp-product-item {
    position: relative;
  }
  
  .hp-product-item img {
    max-width: 500px;
    width: 100%;
  }
  
  .hero-overlay {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 120px 0 0 500px;
    border-color: transparent transparent transparent #F9FAFB;
  }
  
  .hero-text {
    position: absolute;
    bottom: 10px;
    left: 10px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="hp-product-item"&gt;
    &lt;img src="https://images.unsplash.com/photo-1516703914899-e8303d01329a?ixlib=rb-0.3.5&amp;s=9ebf86cdab3a1c7319ff15b16d09b1f7&amp;auto=format&amp;fit=crop&amp;w=1350&amp;q=80"&gt;
    &lt;div class="hp-product-text"&gt;
      &lt;div class="hero-overlay"&gt;&lt;/div&gt;
      &lt;div class="hero-text"&gt;
        &lt;h2&gt;Test&lt;/h2&gt;
        &lt;p&gt;Testing this&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>This works great, my only problem is responsiveness. So as the image gets smaller due to the <code>100% width</code> the border becomes too big it overlaps and causes the layout to break. Now I could change the <code>border-width</code> with media queries but is there a better way to do this?</p>
  
  <p>I've also created a <a href="https://jsfiddle.net/kwtdpnpw/" rel="nofollow noreferrer">fiddle</a></p>