hugo-theme-docdock icon indicating copy to clipboard operation
hugo-theme-docdock copied to clipboard

Changing the highlighting style of code

Open yo80106 opened this issue 7 years ago • 3 comments

Hi, I am wondering if there is a way to change the highlighting style of code. For example, changing the background color from black to white.

yo80106 avatar Sep 20 '17 04:09 yo80106

Yes and really easy. Just tiny prepare:

  1. Copy one of existing color themes from <hugo root>/themes/docdock/static/css/hybrid.css to <hugo root>/static/css/hybrid.css
  2. Change your highlighting theme

There's doc on overall site theming, which is quite a minimal. http://docdock.netlify.com/content-organisation/customize-style/theme-variants/ Maybe this will inspire write better tutorial on custom styles.

Pilskalns avatar Sep 20 '17 12:09 Pilskalns

Thanks for your helping. After I changed some styles, I found there was a black frame surrounding the block of codes. I think this is caused by the copy function of snippet, so can I change the color?

yo80106 avatar Sep 22 '17 01:09 yo80106

I used this additional CSS, to override background for code snippets:

.hljs, pre{
    background-color: %%your_color%%;
}

Pilskalns avatar Sep 22 '17 08:09 Pilskalns