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

主题颜色修改失败 #1043

Closed
Eternal579 opened this issue Jan 11, 2024 · 7 comments
Closed

主题颜色修改失败 #1043

Eternal579 opened this issue Jan 11, 2024 · 7 comments

Comments

@Eternal579
Copy link

为什么我修改了themes下的_config.yml后,本地如我所期待的,更改了上方菜单栏的颜色,而当我更新到GitHub后,我发现怎么弄我都无法修改主题颜色

@Eternal579
Copy link
Author

而且模糊玻璃的效果也如上所说,本地访问是正常的,线上就是没有效果

@Eternal579
Copy link
Author

但其他效果在线上都可以立刻展示出来,就这两个效果更新不出来,浏览器缓存什么的也都弄过了,就是不行

@xiyuvi
Copy link
Contributor

xiyuvi commented Jan 12, 2024

贴一下你修改的内容 和线上地址

@Eternal579
Copy link
Author

修改的代码部分如下:(我仅仅换了颜色而已)

# 主题颜色配置,其他不生效的地方请使用自定义 css 解决,配色可以在下方链接中获得启发
# Theme color, please use custom CSS to solve other colors, color schema can be inspired by the links below
# See: https://www.webdesignrankings.com/resources/lolcolors/
color:
  # body 背景色
  # Color of body background
  body_bg_color: "#FFFFFF" # 纯白
  # 暗色模式下的 body 背景色,下同
  # Color in dark mode, the same below
  body_bg_color_dark: "#181c27"

  # 顶部菜单背景色
  # Color of navigation bar background
  navbar_bg_color: "#E58A8A" # 偏红色
  navbar_bg_color_dark: "#E58A8A" # 偏红色

线上地址为https://bugeater.space/

@Eternal579
Copy link
Author

然后我也修改了themes/fluid/css/_variables/base.styl
修改的部分如下:

// body
$body-bg-color = theme-config("color.body_bg_color", "#FFFFFF")
// navbar
$navbar-bg-color = theme-config("color.navbar_bg_color", "#E58A8A")
$navbar-bg-color-dark = theme-config("color.navbar_bg_color_dark", "#E58A8A")

但依旧没有起效

@Eternal579
Copy link
Author

我似乎解决了,但不知道为什么,我是把public上传在github上,然后同时每次都是通过GitHub desktop把public中更改的文件上传上去,但我刚刚通过在GitHub网站上上传了所有的文件,线上便有效果了😂

@xiyuvi
Copy link
Contributor

xiyuvi commented Jan 12, 2024

你修改的是hexo根目录下的_config.fluid.yml文件吗
如果你的主题是使用npm安装的,并且你把仓库放在了git上执行每次的编译静态工作,那么你在npm包修改的任何内容不会同步到git仓库中。
我修改主题色后生效了,请检查自己的项目
https://xiyu.pro/
我的配置 _config.fluid.yml

color:
  # body 背景色
  # Color of body background
  body_bg_color: "#eee"
  # 暗色模式下的 body 背景色,下同
  # Color in dark mode, the same below
  body_bg_color_dark: "#181c27"

  # 顶部菜单背景色
  # Color of navigation bar background
  # navbar_bg_color: "#2f4154"
  # navbar_bg_color_dark: "#1f3144"
  navbar_bg_color: "#E58A8A"
  navbar_bg_color_dark: "#E58A8A"

image
如果以上内容帮助到你,你可以赞赏本项目负责人,多少随意
image

@zkqiang zkqiang closed this as completed Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants