@import hexo-config('highlight.light.file') if (hexo-config('highlight.enable')); if (hexo-config('prism.enable')) { @import hexo-config('prism.light'); @import hexo-config('prism.number'); } if (hexo-config('darkmode')) { @media (prefers-color-scheme: dark) { @import hexo-config('highlight.dark.file') if (hexo-config('highlight.enable')); @import hexo-config('prism.dark') if (hexo-config('prism.enable')); } } @import 'copy-code' if (hexo-config('codeblock.copy_button.enable')); // Placeholder: $code-inline $code-block $code-inline { background: var(--highlight-background); color: var(--highlight-foreground); } $code-block { @extend $code-inline; line-height: $line-height-code-block; margin: 0 auto 20px; } pre, code { font-family: $code-font-family; } code { @extend $code-inline; border-radius: 3px; font-size: $table-font-size; padding: 2px 4px; word-wrap(); } kbd { @extend $code-inline; background-image: linear-gradient(var(--highlight-gutter-background), var(--highlight-background), var(--highlight-gutter-background)); border: 1px solid $grey-light; border-radius: .2em; box-shadow: .1em .1em .2em rgba(0, 0, 0, .1); font-family: inherit; padding: .1em .3em; white-space: nowrap; } .highlight { @extend $code-block; position: relative; pre { border: 0; margin: 0; padding: 10px 0; } table { border: 0; margin: 0; width: auto; } td { border: 0; padding: 0; } figcaption { background: var(--highlight-gutter-background); color: var(--highlight-foreground); display: flow-root; font-size: $table-font-size; line-height: 1.2; padding: .5em; a { color: var(--highlight-foreground); float: right; &:hover { border-bottom-color: var(--highlight-foreground); } } } .gutter { disable-user-select(); pre { background: var(--highlight-gutter-background); color: var(--highlight-gutter-foreground); padding-left: 10px; padding-right: 10px; text-align: right; } } .code pre { padding-left: 10px; width: 100%; } } .gist table { width: auto; td { border: 0; } } pre { @extend $code-block; overflow: auto; padding: 10px; code { background: none; padding: 0; text-shadow: none; } }