// Asciidoctor-generated markup // ============================ @mixin padded-code-snippet() { padding: 0 .75em; margin: 0 .2em; background: $codeListingBackgroundColor; border: 1px dashed $codeListingBorderColor; border-radius: .25em; font-size: 15px; } @mixin padded-code-snippet--reset() { padding: 0; margin: 0; background: transparent; border: 0; border-radius: 0; } @mixin code-snippet-container() { overflow-x: scroll; overflow-y: hidden; line-height: 1.2; @include padded-code-snippet(); padding-top: .5em; padding-bottom: .5em; border-width: 0 0 0 1px; border-radius: 0 .25em .25em 0; margin-top: 1em; margin-bottom: 1em; margin-left: -.1em; > code { // Avoid bad formatting in case of element nested // inside a
    @include padded-code-snippet--reset();
  }
}

@mixin code-snippet() {
  color: lighten($textColor, 24);

  @include padded-code-snippet();
  margin-top: -1px;
  margin-bottom: -1px;

  code {
    // Avoid bad formatting in case of  elements nested
    // into each other (possible with adoc output)
    @include padded-code-snippet--reset();
  }
}

@mixin asciidoc-markup() {

  // Code listing

  .paragraph code {
    word-break: break-word;
  }
  code {
    @include code-snippet();
  }
  pre {
    @include code-snippet-container();
  }

  // Generic block title

  .admonitionblock,
  .listingblock,
  .imageblock {
    .title {
      text-transform: uppercase;
      font-size: 12px;
      border-radius: .25em;
      background-color: $textColor;
      color: white;
      font-weight: bold;
      padding: .3em .6em .15em .6em;
    }
  }

  // Specific blocks

  .admonitionblock,
  .listingblock {
    margin-top: 1em;
    margin-bottom: 1em;
  }

  .admonitionblock.warning {
    td.icon .title {
      background-color: $warningColor;
    }
  }
  .admonitionblock.important {
    td.icon .title {
      background-color: $importantColor;
    }
  }

  .imageblock {
    .title {
      background-color: $accentColor;
      color: white;
    }
  }

  .listingblock {
    display: flex;
    flex-flow: column nowrap;

    .title {
      align-self: flex-start;
      background-color: $codeListingBorderColor;
      color: white;
      border-radius: 0;
    }

    .content {
      align-self: stretch;

      pre {
        margin: 0;
      }
    }
  }

  .admonitionblock {
    overflow-x: scroll;

    table:first-child {
      margin-top: 0;
    }
    table:last-child {
      margin-bottom: 0;
    }

    td.icon {
      vertical-align: top;
      padding-left: 0;
      padding-right: 1em;
      font-size: 90%;
    }

    .title {
      background-color: $linkColor;
      color: white;
    }

    .content {
      font-size: 90%;

      .title {
        background: transparent;
        color: $textColor;
        padding-left: 0;
      }

      .listingblock pre {
        font-size: 100%;
      }

      > div:first-child {
        > :first-child {
          margin-top: 0;
        }
      }
      > div:last-child {
        > :last-child {
          margin-bottom: 0;
        }
        &.ulist {
          li:first-child > :first-child {
            margin-top: 0;
          }
          li:last-child > :last-child {
            margin-bottom: 0;
          }
        }
      }
    }
  }
  @media all and (-ms-high-contrast: none) {
    body > main .admonitionblock {
      overflow-x: auto;
    }
  }
}