只要元素具有 CSS 不透明度,Firebase 托管就会将元素的不透明度更改为 1%

Firebase hosting changes an element's opacity to 1% whenever it has CSS opacity

我正在使用 Vue.js 和 Firebase 开发一个网站。在本地,一切正常,我打算将不透明度设置为低的按钮也可以正常工作。每当我部署到 Firebase 托管时,该按钮都会将其不透明度更改为 1%,因此变得不可见。我必须删除任何不透明度 CSS 才能让它工作,因为任何东西都会自动降低到 1%。正如我所说,仅在托管中发生,而在本地它按预期工作。任何想法可能会发生什么? 我已经多次构建和部署以解决可能发生的任何构建错误。

这听起来像是人们 运行 在 using Sass 时遇到的常见问题。

Percentages in Sass work just like every other unit. They are not interchangeable with decimals, because in CSS decimals and percentages mean different things. For example, 50% is a number with % as its unit, and Sass considers it different than the number 0.5.

不要在 CSS 中使用百分比,而是将它们更改为等效的十进制表示法。

例如,使用 opacity: 0.8; 而不是 opacity: 80%;