Coder Social home page Coder Social logo

Comments (2)

starkshaw avatar starkshaw commented on May 31, 2024 5

You can add custom CSS for .dark-theme to override that. I am using something like this in custom.styl:

// Dark mode for pre
.dark-theme .post-content figure,
.dark-theme .post-content figure.highlight .code pre {
    background-color: $dark-post-blockquote-background-color;
    color: $dark-mode-pre-foreground-color;
}

// Dark mode for pre line number
.dark-theme .post-content figure.highlight .gutter pre {
    background-color: $dark-post-blockquote-background-color;
    color: $dark-mode-pre-line-number-foreground-color;
}

Then you can specify the foreground color and background color of your choice.

from hexo-theme-chic.

JacHammer avatar JacHammer commented on May 31, 2024 2

我的解决方法是在Chic/source/css/_highlight下修改部分颜色定义达到code block dark mode 效果,不过这样也会强制light mode也显示这种效果

// Highlight Color
$highlight-deletion     = #fdd
$highlight-addition     = #dfd
$highlight-background   = #303030
$highlight-current-line = #efefef
$highlight-selection    = #d6d6d6
$highlight-foreground   = #c8c8c8
$highlight-comment      = #718c00
$highlight-red          = #c82829
$highlight-orange       = #f5871f
$highlight-yellow       = #eab700
$highlight-green        = #718c00
$highlight-aqua         = #3e999f
$highlight-blue         = #4271ae
$highlight-purple       = #8959a8
$highlight-gutter       = #869194

from hexo-theme-chic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.