.source .shiki {
  --shiki-foreground: var(--codeblock-text);
  --shiki-background: var(--codeblock-back);
  --shiki-token-constant: var(--blue-50);
  --shiki-token-string: var(--brand-60);
  --shiki-token-string-expression: var(--shiki-token-string);
  --shiki-token-comment: var(--grey-60);
  --shiki-token-keyword: var(--grey40-60);
  --shiki-token-parameter: var(--indigo-40);
  --shiki-token-function: var(--indigo-40);
  --shiki-token-punctuation: var(--grey20-70);
  --shiki-token-link: var(--blue-60);
  --shiki-highlight-background: var(--grey-95);
  --shiki-highlight-foreground: var(--brand-30);
  --shiki-highlight-border: var(--grey20-85);
  --shiki-line-numbers: var(--grey20-80);
  --shiki-line-numbers-highlighted: var(--grey-65);
  --padding: 1rem;
  --highlight-border-width: 0rem;
  font-family: var(--font-mono);
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  padding: var(--padding);
  span.line {
    display: block;
  }
  span.line.highlighted {
    background-color: var(--shiki-highlight-background);
    margin: 0 calc(0rem - var(--padding));
    padding: 0 calc(var(--padding) - var(--highlight-border-width));
    border-left: var(--highlight-border-width) solid var(--shiki-highlight-border);
    min-width: 120%;
    width: fit-content;
  }
  code {
    counter-reset: step;
    counter-increment: step 0;
  }
  code span.line::before {
    content: counter(step);
    counter-increment: step;
    width: 1rem;
    margin-right: 1rem;
    display: inline-block;
    text-align: right;
    // color: rgba(115,138,148,.4)
    color: var(--shiki-line-numbers);
  }
  code span.line.highlighted::before {
    color: var(--shiki-line-numbers-highlighted);
  }
  code .line:empty {
    // fix for extra blank line appearing after blank lines
    display: inline-block
  }
}

.source.no-line-numbers .shiki {
  code span.line::before {
    display: none;
  }
}

#{$dark-theme} {
  .source .shiki {
    --shiki-foreground: var(--codeblock-text);
    --shiki-background: var(--codeblock-back);
    --shiki-token-constant: var(--blue-50);
    --shiki-token-string: var(--brand-70);
    --shiki-token-string-expression: var(--shiki-token-string);
    --shiki-token-comment: var(--grey-40);
    --shiki-token-keyword: var(--grey40-50);
    --shiki-token-parameter: var(--indigo-60);
    --shiki-token-function: var(--indigo-70);
    --shiki-token-punctuation: var(--grey20-40);
    --shiki-token-link: var(--blue-40);
    --shiki-highlight-background: var(--grey-10);
    --shiki-highlight-foreground: var(--brand-70);
    --shiki-highlight-border: var(--brand-50);
    --shiki-line-numbers: var(--grey20-30);
    --shiki-line-numbers-highlighted: var(--grey20-45);
  }
}
