There are no notes for this item.

<p class="intro">Spacing modifiers can be applied to increase or decrease visual spacing around the horizontal rule, examples below.</p>
<p class="intro">It's also possible to use the <code>margin-y-[size]</code> <a href="/components/detail/spacing" target="_top">spacing utility</a> for finer control.</p>

<p>Lipsum has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<div><strong>Regular spacing:</strong></div>

<hr class="" />

<p>Lipsum has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<div><strong>'Spaced'</strong></div>

<hr class="hr--spaced" />

<p>Lipsum has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<div><strong>'Compact'</strong></div>

<hr class="hr--compact" />

<p>Lipsum has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p class="intro">Spacing modifiers can be applied to increase or decrease visual spacing around the horizontal rule, examples below.</p>
<p class="intro">It's also possible to use the <code>margin-y-[size]</code> <a href="/components/detail/spacing" target="_top">spacing utility</a> for finer control.</p>

<p>{{ lorem }}</p>

<div><strong>Regular spacing:</strong></div>

<hr class="" />

<p>{{ lorem }}</p>

<div><strong>'Spaced'</strong></div>

<hr class="hr--spaced" />

<p>{{ lorem }}</p>

<div><strong>'Compact'</strong></div>

<hr class="hr--compact" />

<p>{{ lorem }}</p>
  • Content:
    $hr-tri-size: 1em;
    
    hr {
      position: relative;
      // see base-elements in vars/_typography
    }
    
    .hr--primary {
      border-top-width: 2px;
      border-color: $primary;
    }
    
    // Spacing
    
    .hr--compact {
      margin: $spacing-xl auto;
    }
    
    .hr--spaced {
      margin: $spacing-5xl auto;
    }
    
    .hr--invisible {
      border-color: transparent;
    }
    
    // Styled variants
    
    [class*='hr--tri-'] {
      border-color: $primary;
      //border-width: 2px;
    
      &:before,
      &:after {
        position: absolute;
        content: '';
        display: inline-block;
        width: 0;
        height: 0;
        border-style: solid;
        border-color: transparent;
      }
    }
    
    .hr--tri-above-left {
      &:before {
        bottom: 0;
        left: 0;
        border-width: $hr-tri-size 0 0 $hr-tri-size;
        border-color: transparent transparent transparent $primary;
      }
    }
    
    .hr--tri-below-left {
      &:before {
        top: 0;
        left: 0;
        border-width: $hr-tri-size $hr-tri-size 0 0;
        border-color: $primary transparent transparent transparent;
      }
    }
    
    .hr--tri-above-right {
      &:after {
        bottom: 0;
        right: 0;
        border-width: 0 0 $hr-tri-size $hr-tri-size;
        border-color: transparent transparent $primary transparent;
      }
    }
    
    .hr--tri-below-right {
      &:after {
        top: 0;
        right: 0;
        border-width: 0 $hr-tri-size $hr-tri-size 0;
        border-color: transparent $primary transparent transparent;
      }
    }
  • URL: /components/raw/hr/_hr.scss
  • Filesystem Path: src/components/hr/_hr.scss
  • Size: 1.3 KB