/* 代码字体 */
@font-face {
  font-family: MyFont;
  src: url(@codefont);
}
/* 代码块字体 */
#article-container code,
#article-container pre {
  font-family: MyFont !important;
}

/* 代码框背景色和字体顔色 */
/* 必须配置(把下面 pre[class*="language-"]的color和background复製到这里来) */
#article-container figure.highlight,
#article-container pre[class*='language-'] {
  background: var(--hl-bg);
  color: var(--hl-color);
}

/* 代码框工具栏 (如果你关掉了copy、lang和shrink,可不用配置这个) */
#article-container figure.highlight .highlight-tools {
  color: #a9a9a9;
  background: var(--hltools-bg);
  .code-lang {
    left: 50% !important;
    transform: translateX(-50%);
    font-size: 0.7rem;
  }
}

/* 代码框行数(如果已经关掉line_number,可以不用配置这个) */
#article-container
  pre[class*='language-'].line-numbers
  .line-numbers-rows
  > span:before {
  color: var(--hlnumber-color);
}

/* 代码块figcaption配置(hexo自带标签https://hexo.io/zh-tw/docs/tag-plugins.html#Code-Block) */
/* 不需要可以不用配置这个 */
// #article-container figure.highlight .caption,
// #article-container figure.highlight .caption a {
//   color: xxxxx !important;
// }

/* 代码框滚动条 (需要可配置，默认为主题主顔色）*/
/* 不需要可以不用配置这个 */
#article-container pre[class*='language-']::-webkit-scrollbar-thumb {
  // background: xxxx !important;
  background-color: #49b1f5 !important;
  background-image: -webkit-linear-gradient(
    45deg,
    hsla(0, 0%, 100%, 0.4) 25%,
    transparent 0,
    transparent 50%,
    hsla(0, 0%, 100%, 0.4) 0,
    hsla(0, 0%, 100%, 0.4) 75%,
    transparent 0,
    transparent
  ) !important;
  border-radius: 2em !important;
}

code[class*='language-'],
pre[class*='language-'] {
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  color: #90a4ae;
  background: #fafafa;
  font-family: Roboto Mono, monospace;
  font-size: 1em;
  line-height: 1.5em;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

code[class*='language-']::-moz-selection,
pre[class*='language-']::-moz-selection,
code[class*='language-'] ::-moz-selection,
pre[class*='language-'] ::-moz-selection {
  background: #cceae7;
  color: #263238;
}

code[class*='language-']::selection,
pre[class*='language-']::selection,
code[class*='language-'] ::selection,
pre[class*='language-'] ::selection {
  background: #cceae7;
  color: #263238;
}

:not(pre) > code[class*='language-'] {
  white-space: normal;
  border-radius: 0.2em;
  padding: 0.1em;
}

pre[class*='language-'] {
  overflow: auto;
  position: relative;
  margin: 0.5em 0;
  padding: 1.25em 1em;
}
@orange: #f76d47;
@purple: #7c4dff;
@cyan: #39adb5;
@yellow: #f6a434;
@blue: #6182b8;
@grey: #aabfc9;
@red: #e53935;
.language-css > code,
.language-sass > code,
.language-scss > code {
  color: @orange;
}
[class*='language-'] {
  .namespace {
    opacity: 0.7;
  }
}
.token {
  &.id {
    font-weight: bold;
  }
  &.important {
    font-weight: bold;
  }
  &.atrule,
  &.boolean,
  &.constant,
  &.function,
  &.important,
  &.id,
  &.symbol,
  &.keyword {
    color: @purple !important;
  }

  &.class-name,
  &.regex {
    color: @blue !important;
  }

  &.unit,
  &.hexcode,
  &.number {
    color: @orange !important;
  }
  &.prolog,
  &.comment,
  &.doctype {
    color: @grey !important;
  }
  &.property,
  &.punctuation,
  &.inserted,
  &.operator,
  &.char,
  &.class,
  &.cdata,
  &.builtin,
  &.attr-name {
    color: @cyan !important;
  }

  &.pseudo-element,
  &.string,
  &.pseudo-class,
  &.attr-value,
  &.attribute {
    color: @yellow !important;
  }
  &.url,
  &.variable,
  &.selector,
  &.deleted,
  &.entity,
  &.tag {
    color: @red !important;
  }
}
