@mixin gfm {
  @include markdownDefaults;
  @include markdownOverrides;
}

@mixin markdownDefaults {
  & {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    position: relative;
    font-family: var(--markdown-font);
    line-height: var(--markdown-line-height);
    color: var(--markdown-text);
    word-wrap: break-word;
    @include _clearfix();
  }

  ul {
    list-style: initial;
  }

  .anchor {
    float: left;
    line-height: 1;
    margin-left: -20px;
    padding-right: 4px
  }

  .anchor:focus {
    outline: 0
  }

  h1:hover .anchor,
  h2:hover .anchor,
  h3:hover .anchor,
  h4:hover .anchor,
  h5:hover .anchor,
  h6:hover .anchor {
    text-decoration: none
  }

  details {
    display: block
  }

  summary {
    display: list-item
  }

  a {
    transition: .15s ease;

    &:hover {
      text-decoration: underline;
    }
  }

  a:active,
  a:hover {
    outline-width: 0
  }

  a:not([href]) {
    color: inherit;
    text-decoration: none
  }

  strong {
    font-weight: inherit;
    font-weight: bolder
  }

  h1 {
    font-size: 2em;
    margin: .67em 0
  }

  hr {
    box-sizing: content-box;

    height: 0;
    overflow: hidden;
    margin: 15px 0;

    border-width: 0 0 1px;
    border-bottom: 1px solid var(--markdown-edge, #dfe2e5);
    background: transparent;

    @include _clearfix();
  }

  input {
    font: inherit;
    margin: 0
  }

  input {
    overflow: visible
  }

  [type=checkbox] {
    box-sizing: border-box;
    padding: 0
  }

  * {
    box-sizing: border-box
  }

  input {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit
  }

  strong {
    font-weight: 600
  }

  details summary {
    cursor: pointer
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    line-height: 1.25;
    color: var(--markdown-title);
    font-family: var(--markdown-title-font);
    font-size: var(--markdown-title-size);
    font-weight: var(--markdown-title-weight, 600);
    margin-top: var(--markdown-title-marginTop, 1em);
    margin-bottom: var(--markdown-title-marginBottom, 1rem);
  }

  h1 {
    font-size: 1.75em;
    font-size: var(--markdown-title-size, 1.75em);
  }
  
  h2 {
    font-size: 1.5em;
    font-size: var(--markdown-title-size, 1.5em);
  }

  h1 {
    font-weight: 700;
    font-weight: var(--markdown-title-weight, 700);
  }

  h2 {
    font-weight: 600;
    font-weight: var(--markdown-title-weight, 600);
  }

  h3,
  h4 {
    font-weight: 600;
    font-weight: var(--markdown-title-weight, 600);
  }

  h3 {
    font-size: 1.25em;
    font-size: var(--markdown-title-size, 1.25em);
  }

  h4 {
    font-size: 1em;
    font-size: var(--markdown-title-size, 1em);
  }

  h5,
  h6 {
    font-weight: 600;
    font-weight: var(--markdown-title-weight, 600);
  }

  h5 {
    font-size: .875em;
    font-size: var(--markdown-title-size, .875em);
  }

  h6 {
    font-size: .85em;
    font-size: var(--markdown-title-size, .85em);
    color: var(--markdown-title, #6a737d);
  }

  p,
  .p {
    margin-bottom: 10px;
    margin-top: 0
  }

  blockquote {
    margin: 0
  }

  ol,
  ul {
    margin-bottom: 0;
    margin-top: 0;
    padding-left: 0
  }

  ol ol,
  ul ol {
    list-style-type: lower-roman
  }

  ol ol ol,
  ol ul ol,
  ul ol ol,
  ul ul ol {
    list-style-type: lower-alpha
  }

  dd {
    margin-left: 0
  }

  input::-webkit-inner-spin-button,
  input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0
  }

  &> :first-child {
    margin-top: 0 !important
  }

  &>:last-child {
    margin-bottom: 0 !important
  }

  blockquote,
  dl,
  ol,
  p,
  pre,
  table,
  ul {
    margin-top: 0;
    margin-bottom: 15px;
  }

  blockquote {
    display: block;
    border-left: .25em solid #dfe2e5;
    color: #6a737d;
    padding: 0 1em
  }

  blockquote>:first-child {
    margin-top: 0
  }

  blockquote>:last-child {
    margin-bottom: 0
  }

  ol,
  ul {
    padding-left: 2em
  }

  ol ol,
  ol ul,
  ul ol,
  ul ul {
    margin-bottom: 0;
    margin-top: 0
  }

  li {
    word-wrap: break-all
  }

  li>p {
    margin-top: 1em
  }

  li+li {
    margin-top: .25em
  }

  dl {
    padding: 0
  }

  dl dt {
    font-size: 1em;
    font-style: italic;
    font-weight: 600;
    margin-top: 1em;
    padding: 0
  }

  dl dd {
    margin-bottom: 1em;
    padding: 0 1em
  }

  :checked+.radio-label {
    border-color: var(--project-color-primary);
    position: relative;
    z-index: 1
  }

  .task-list-item {
    list-style-type: none
  }

  .task-list-item+.task-list-item {
    margin-top: 3px
  }

  .task-list-item input {
    margin: 0 .2em .25em -1.6em;
    vertical-align: middle
  }

  p.blank-line {
    height: 1.5em;
  }
}

@mixin markdownOverrides {
  h5,
  h6 {
    font-size: .9em;
  }


  blockquote h1:last-child,
  blockquote h2:last-child {
    border-bottom: 0;
  }


  >* {
    margin-top: 15px;
    margin-bottom: 15px !important;
  }


  .task-list-item input {
    margin: 0 .5em .25em -1.25em;
  }

  a[href], a:not([href=""]) {
    text-decoration: underline
  }
}

@mixin _clearfix() {
  &:before, &:after {
    content: "";
    display: table;
  }
  &:after { clear: both }
}
