@mixin common-vars($isDark) {
  .#{$prefix}-preview {
    // 文字
    --md-theme-color: var(--md-color);
    --md-theme-color-reverse: #{if($isDark, #222, #eee)};
    --md-theme-color-hover: #{if($isDark, #191919, #eee)};
    --md-theme-color-hover-inset: #{if($isDark, #444, #ddd)};

    --md-theme-link-color: #{if($isDark, #2d8cf0, #2d8cf0)};
    --md-theme-link-hover-color: #{if($isDark, #73d13d, #73d13d)};

    // 边框
    --md-theme-border-color: #{if($isDark, #2d2d2d, #e6e6e6)};
    --md-theme-border-color-reverse: #{if($isDark, #e6e6e6, #bebebe)};
    --md-theme-border-color-inset: #{if($isDark, #5a5a5a, #d6d6d6)};

    // 背景
    --md-theme-bg-color: #{if($isDark, #000, #fff)};
    --md-theme-bg-color-inset: #{if($isDark, #111, #ececec)};

    // 滚动条
    --md-theme-bg-color-scrollbar-track: #{if($isDark, #0f0f0f, #e2e2e2)};
    --md-theme-bg-color-scrollbar-thumb: #{if($isDark, #2d2d2d, #0000004d)};
    --md-theme-bg-color-scrollbar-thumb-hover: #{if($isDark, #3a3a3a, #00000059)};
    --md-theme-bg-color-scrollbar-thumb-active: #{if($isDark, #3a3a3a, #00000061)};

    // 代码
    --md-theme-code-copy-tips-color: inherit; // 复制文字
    --md-theme-code-copy-tips-bg-color: #{if($isDark, #3a3a3a, #fff)}; // 背景
    --md-theme-code-active-color: #{if($isDark, #e6c07b, #61aeee)}; // 激活状态
  }
}

.#{$prefix} {
  @include common-vars(false);
}

.#{$prefix}-dark {
  @include common-vars(true);
}
