小编Maj*_*jka的帖子

使用CSS变量作为Sass函数参数

有没有办法使用Sass函数的CSS变量,例如减轻?像这样的东西:

:root {
  --color: #ff00ff;
}

.div {
  background-color: lighten(var(--color), 32%);
}
Run Code Online (Sandbox Code Playgroud)

我收到一条错误消息,"论证$colorlighten($color, $amount)必须是一种颜色".

我正在使用CSS(而不是Sass)变量,因为我需要在js中使用它们.

css variables sass css3 css-variables

15
推荐指数
1
解决办法
4928
查看次数

PWA在Github页面上

我正在我的页面上工作PWA,我正在关注100%这个简单的代码框 - https://codelabs.developers.google.com/codelabs/add-to-home-screen/#0一切正常(在使用exmaple代码,也在我自己的网页上),但只有当我在localhost上测试它.在github页面上部署后,我遇到了很多错误:

  1. GET https://[myusername].github.io/manifest.json 404 () (即路径可能有问题,因为我猜在清单文件之前应该有项目名称)
  2. Manifest: Line: 1, column: 1, Unexpected token. (在devtools中我可以看到虽然它是正常的json文件,但它在我的localhost上工作正常);
  3. TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
  4. 在devtools中单击"添加到主屏幕"后,我得到了:Manifest: Line: 1, column: 1, Unexpected token.Site cannot be installed: the manifest could not be fetched, is empty, or could not be parsed.

有任何想法吗?我不知道我做错了什么或者github页面出了什么问题......

javascript github github-pages progressive-web-apps

5
推荐指数
1
解决办法
1827
查看次数