@import '../vars.less';

.spfx-page-doc {
  code, code * {
    font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace
  }

  .spfx-doc {
    min-height: 100vh;
    background: #fff;
    overflow: hidden;

    &-content {
      margin-left: 255px;
      padding: 40px;
    }

    &-link {
      display: block;
      height: 40px;
      padding-left: 20px;
      line-height: 40px;
      @link-color: rgb(0, 0, 0);

      &:after {
        content: '';
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        border-left: 3px solid @link-color;
        visibility: hidden;
      }

      &--active,
      &:hover {
        background: rgba(@link-color, 0.05);
      }

      &--active:after,
      &:hover:after {
        visibility: visible;
      }
    }
    pre {
      margin: 10px 0;
      background: #fff;
    }
  }

  // generate by markdown-loader
  .spfx-document {
    color: rgba(0, 0, 0, 0.8);

    // line-height: 28 / 14;
    & > h2 {
      font-weight: normal;
      font-size: 32px;
      margin: 49px 0;

      &:nth-child(1) {
        margin-top: 0;
      }
    }

    & > h3 {
      font-weight: normal;
      font-size: 20px;
      margin: 30px 0;
    }

    & > h4 {
      margin: 20px 0;
      font-size: 18px;
      font-weight: normal;
    }

    & > p {
      font-size: 14px;

      img {
        max-width: 100%;
        margin: 10px 0;
      }
    }

    & > ul {
      > li {
        position: relative;
        padding-left: 20px;
        margin-bottom: 15px;
        p {
          font-size: 16px;
        }
        &:before {
          content: '';
          display: inline-block;
          position: absolute;
          top: 8px;
          left: 0;
          width: 8px;
          height: 8px;
          border-radius: 100%;
          background: @text-color;
          margin-right: 10px;
        }
        > ul {
          padding-left: 10px;
        }
      }
    }

    &-article {
      h1,
      h2,
      h3,
      h4,
      h5,
      h6 {
        font-weight: normal;
        margin: 30px 0 15px;
        color: #333;
        position: relative;
      }

      h1 {
        font-size: 22px;
      }

      h2 {
        font-size: 20px;
      }

      h3 {
        font-size: 18px;
      }

      h4 {
        font-size: 16px;
      }

      h5 {
        font-size: 14px;
      }

      h6 {
        font-size: 14px;
      }

      p,
      div {
        word-wrap: break-word;
        margin: 0 0 15px 0;
        // color: #333;
        word-wrap: break-word;
      }

      a {
        color: #3b91d3;
        text-decoration: none;
        word-break: break-all;
        background-repeat: no-repeat;
      }

      a:hover {
        color: #0f769f;
      }

      a:hover,
      a:active {
        outline: 0;
      }

      b,
      strong {
        font-weight: bold;
      }

      i,
      em {
        font-style: italic;
      }

      u {
        text-decoration: underline;
      }

      strike,
      del {
        text-decoration: line-through;
      }

      ul,
      ol {
        list-style: disc outside none;
        margin: 15px 0;
        padding: 0 0 0 40px;
        line-height: 1.8;

        li {
          list-style: inherit;
        }

        ul,
        ol {
          padding-left: 30px;
        }

        ul {
          list-style: circle outside none;

          ul {
            list-style: square outside none;
          }
        }
      }

      ol {
        list-style: decimal;
      }

      img {
        max-width: 100%;
        height: auto;
        vertical-align: middle;
      }

      table {
        width: 100% !important;
        max-width: 100%;
        table-layout: auto;
        border-collapse: collapse;
        border-spacing: 0;
        margin: 15px 0;

        thead {
          background-color: #f9f9f9;
        }

        td,
        th {
          min-width: 40px;
          height: 30px;
          border: 1px solid #e9e9e9;
          vertical-align: top;
          padding: 4px 6px;
          text-align: left;
          box-sizing: border-box;

          &.active {
            background-color: #ffffee;
          }
        }
      }
    }
  }
}
