Hexo-theme-next: 如何修改模板的背景色?

Created on 2 Jan 2017  ·  10Comments  ·  Source: iissnan/hexo-theme-next

Expected behavior (预期行为)

希望更改模板的背景色

Actual behavior (实际行为)

Steps to reproduce the behavior (重现步骤)

NexT Informations

Add the ✔ sign before an item which is affected by this behavior.

NexT Version:

  • Master
  • Latest Release
  • Old version -

NexT Scheme:

  • All schemes
  • Muse
  • Mist
  • Pisces

Other Informations (Like Browser, System, Screenshots)

0 - Backlog

Most helpful comment

next 的配色文件
\Hexo\themesnext\source\css_variablesbase.styl
附:
添加body背景图
在hexo\themesnext\source\css_custom\custom.styl
文件的最上方加上一代码 body { background:url(‘/xxx/xxx.jpg (你的图片路径) ’);}
添加header背景
在Hexo\themes\hexo-theme-next\source\css_common\components\header
修改.header { background: $head-bg; }为.header { background: url('.xx/xx/xxx.jpg (你的图片路径) '); }

All 10 comments

next 的配色文件
\Hexo\themesnext\source\css_variablesbase.styl
附:
添加body背景图
在hexo\themesnext\source\css_custom\custom.styl
文件的最上方加上一代码 body { background:url(‘/xxx/xxx.jpg (你的图片路径) ’);}
添加header背景
在Hexo\themes\hexo-theme-next\source\css_common\components\header
修改.header { background: $head-bg; }为.header { background: url('.xx/xx/xxx.jpg (你的图片路径) '); }

@monsterLin solved?

@sirlh is there a way to cover the canvas-nest animation with body background color? Right now the js renders animation on top of post's bg color, really distracting.

nvm I found the way
added .post-block { background: #ffffff; }
to source/css/_common/components/post/post.styl

@sirlh 试了一下,没反应啊。你说的是live preview里Muse scheme里的第一个blog XiaMo那种效果吗

@ladychili 并不是那个修改动画,而是直接添加了背景图片,如果添加动画,在使用文档中有详细的说明。

@sirlh Umm.. 我就是说添加header背景图片,之前是我路径弄错了,照你的说的已经弄好了。非常感谢~ >.<

刚研究了下,如果想更改全部的背景色,需要修改以下几处:
1、themes/next/source/css/_variables/Pisces.styl
$body-bg-color = #ffffff

2、source/css/_common/components/post/post.styl
.post-block { background: #ffffff; }

3、themesnext\source\css_schemes\Pisces_layout.styl
.content-wrap
background: #ffffff;
.header-inner
background: #ffffff;

4、themesnext\source\css_schemes\Pisces_sidebar.styl
.sidebar-inner
background: #ffffff;

@ivan-nginx ok , I had solved , thanks

@sirlh thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ifgao picture ifgao  ·  4Comments

zhgcao picture zhgcao  ·  3Comments

DVD0423 picture DVD0423  ·  3Comments

chy9002 picture chy9002  ·  3Comments

payne4handsome picture payne4handsome  ·  4Comments