Select Page

Terms and Conditions

<style> @mixin number-nested(
  $depth,
  $after: '',
  $start: 1,
  $style: decimal,
  $seperator: '.'
){
  list-style: none;
  $selector: '';
  $content: counter(level0, $style);
  @for $i from 0 to $depth {
    & #{$selector} {
      counter-reset: level#{$i} if($i==0, $start - 1, null);
    }
    & #{$selector} li::before {
      content: $content $after;
      counter-increment: level#{$i};
      @content;
    }
    $selector: $selector + ' ol';
    $content: $content $seperator counter(level#{$i+1}, $style);
  }
}

ol {
  @include number-nested(3, ' ') {
    position: absolute;
    right: 100%;
    margin-right: .5em*(1/0.8);
    text-align: right;
    font-weight: bold;
    font-size: 0.8em;
  }
  position: relative;
  padding-left: 3em;
  margin: 0;
}
        
li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  position: relative;
}

body {
  //column-count: 2;
  padding: 2em;
  font-size: 1em;
  font-family: serif;
  background: #f0ebdc;
  color: #532;
}
</style>

<h1>Numbered Nested Lists</h1>
<ol>
  <li>Section 1
      <ol>
      <li>Section 1.1</li>
      <li>Section 1.2</li>
    </ol>
  </li>
  <li>Section 2</li>
  <li>Section 3
    <ol>
      <li>Section 3.1</li>
      <li>Section 3.2
        <ol>
          <li>Section 3.2.1</li>
          <li>Section 3.2.2</li>
          <li>Section 3.2.3</li>
        </ol>
      </li>
      <li>Section 3.3</li>
      <li>Section 3.4</li>
    </ol></li>
  <li>Section 4</li>
</ol>