Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码高亮可以根据dark或light来选择主题 #50

Open
pengxiaotg opened this issue Jan 15, 2020 · 2 comments
Open

代码高亮可以根据dark或light来选择主题 #50

pengxiaotg opened this issue Jan 15, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@pengxiaotg
Copy link

pengxiaotg commented Jan 15, 2020

Chic对黑暗模式对支持非常棒,美中不足的地方是如果我选择亮色主题,在dark mode下就会比较突兀,大佬是否可以支持下代码高亮双主题根据dark or light来切换

另,检索功能+1

@JacHammer
Copy link

我的解决方法是在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

@Siricee Siricee added the enhancement New feature or request label Jan 29, 2020
@starkshaw
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants