title: How does border-image work with linear-gradient?
body: <p>I am trying to understand how border-image-slice works in the case of gradient border image. In spec it is written that a value for border-image-slice could be a number which</p>
  
  <blockquote>
    <p>Represents an edge offset in pixels for raster images and coordinates for vector images. For vector images, the number is relative to the element's size, not the size of the source image, so percentages are generally preferable in these cases.</p>
  </blockquote>
  
  <p>In the <a href="https://codepen.io/team/css-tricks/pen/3e249da77243daaf72656f70fb757f66" rel="nofollow noreferrer">examples</a> from CSS-tricks <a href="https://css-tricks.com/the-backgound-clip-property-and-use-cases/" rel="nofollow noreferrer">article</a> a border-image is set like this:</p>
  
  <pre><code>border-image: repeating-linear-gradient(45deg, 
          #000, #000 1.5%, 
          transparent 1.5%, transparent 5%) 80;
  </code></pre>
  
  <p>So, according to the spec 80 is relative to the div's size (width: 26em; height: 23em;). But I still don't understand what does it mean. When I change div's width or height, the border image doesn't change its look. But when I change border-image-slice or border width, the look changes significantly. So it seems like there is a correlation between number 80 and the border width of 5em. (the border looks the same for number 40 and border width of 2.5em, 16 for 1em, etc.).</p>
  
  <p>My question is how number 80 is calculated meaning what is the slicing process for a given div and the gradient? (A sketch would be greatly appreciated)
  And it seems like 80 is not in px, em or %, because when I add those units the look is changing.</p>
  
  <p>The full code is here:</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>div {
   box-sizing: border-box;
   position: relative;
   border: solid 5em #000;
   border-image: repeating-linear-gradient(45deg, 
     #000, #000 1.5%, 
     transparent 1.5%, transparent 5%) 80;
   padding: 2em;
   width: 26em; height: 23em;
   background: linear-gradient(to right bottom, 
     #e18728, #4472b9);
   background-size: 50% 50%; 
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>