【问题标题】:Problem with css variable and jekyll to post site on github pagescss 变量和 jekyll 在 github 页面上发布网站的问题
【发布时间】:2021-09-22 03:38:00
【问题描述】:

我对 GitHub 页面、SASS、CSS 和 Jekyll 有疑问。我使用 --[variable name]: variable value 为颜色和文件声明了一些 CSS 变量,例如:

--logo_light: url("../img/logo-desktop.svg") no-repeat;
--crearGifo_light: url("../img/button-crear-gifo.svg") no-repeat;
--crearGifoHover_light: url("../img/CTA-crear-gifo-hover.svg") no-repeat;

问题是当我尝试使用 Github 页面发布网站时,GitHub 给了我以下错误:

 Your site is having problems building: Your SCSS file styles/styles.scss has an error on line 26: Invalid CSS after " --logo_light: ": expected "}", was "url("../img/log...". For more information, see https://docs.github.com/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites#invalid-sass-or-scss.

我检查了文档,但找不到解决方案,我尝试将{{ variable value }} 添加到文档中所说的变量值中,但没有奏效,任何帮助将不胜感激。谢谢!

回购: https://github.com/nicolaszuleta95/Proyecto2_Acamica_GIFOS

【问题讨论】:

标签: css sass jekyll github-pages


【解决方案1】:

我认为问题在于 sass 文件中的相对路径。尝试将 ../ 更改为 /。我的意思是从 root 开始并使用适当的路径,看看它是否有效。

【讨论】:

  • 尝试像你说的那样改变路径,但我得到了同样的错误
  • 你检查了这个链接stackoverflow.com/questions/8608498/…
  • 是的,检查了链接尝试使用该语法但没有工作
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-10-08
  • 2016-07-31
  • 2018-04-15
  • 2021-05-17
  • 2013-08-11
  • 2018-05-15
  • 1970-01-01
相关资源
最近更新 更多